[NDS] Don't try to check for null in an out of range array (#2979)

I have no idea wtf I was thinking with this
This commit is contained in:
CasualPokePlayer 2021-10-25 07:10:04 -07:00 committed by GitHub
parent bc9331cb6f
commit d3bebefcbc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -38,6 +38,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.NDS
} }
bool gbacartpresent = roms.Count > 1; bool gbacartpresent = roms.Count > 1;
bool gbasrampresent = roms.Count == 3;
_tracecb = MakeTrace; _tracecb = MakeTrace;
@ -96,7 +97,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.NDS
if (gbacartpresent) if (gbacartpresent)
{ {
_exe.AddReadonlyFile(roms[1], "gba.rom"); _exe.AddReadonlyFile(roms[1], "gba.rom");
if (roms[2] != null) if (gbasrampresent)
{ {
_exe.AddReadonlyFile(roms[2], "gba.ram"); _exe.AddReadonlyFile(roms[2], "gba.ram");
} }
@ -135,7 +136,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.NDS
if (gbacartpresent) if (gbacartpresent)
{ {
_exe.RemoveReadonlyFile("gba.rom"); _exe.RemoveReadonlyFile("gba.rom");
if (roms[2] != null) if (gbasrampresent)
{ {
_exe.RemoveReadonlyFile("gba.ram"); _exe.RemoveReadonlyFile("gba.ram");
} }