fix BANDAI FCG 1 Boards without barcode reader

This commit is contained in:
goyuken 2014-12-14 17:19:54 +00:00
parent 09f9d50f46
commit 10e38e7bc9
2 changed files with 6 additions and 1 deletions

View File

@ -67,6 +67,8 @@ namespace BizHawk.Emulation.Common
public void Register<T>(T provider)
where T : IEmulatorService
{
if (provider == null)
throw new ArgumentNullException("provider");
Services[typeof(T)] = provider;
}

View File

@ -53,7 +53,10 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
if (board is BANDAI_FCG_1)
{
(ServiceProvider as BasicServiceProvider).Register<DatachBarcode>((board as BANDAI_FCG_1).reader);
var reader = (board as BANDAI_FCG_1).reader;
// not all BANDAI FCG 1 boards have a barcode reader
if (reader != null)
(ServiceProvider as BasicServiceProvider).Register<DatachBarcode>(reader);
}
}