fix crash in gbagame slot2 addon when gba rom doesn't exist

This commit is contained in:
zeromus 2016-03-30 23:50:54 +00:00
parent bf911bf571
commit aba30866b1
1 changed files with 2 additions and 3 deletions

View File

@ -1,6 +1,6 @@
/*
Copyright (C) 2009 CrazyMax
Copyright (C) 2009-2015 DeSmuME team
Copyright (C) 2009-2016 DeSmuME team
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -359,15 +359,14 @@ public:
printf("GBASlot opening ROM: %s\n", GBACartridge_RomPath.c_str());
EMUFILE_FILE *inf = new EMUFILE_FILE(GBACartridge_RomPath, "rb");
inf->EnablePositionCache();
fROM = inf;
if (fROM->fail())
{
printf(" - Failed\n");
Close();
return;
}
inf->EnablePositionCache();
romSize = fROM->size();
printf(" - Success (%u bytes)\n", romSize);