Don't crash if no ROM is loaded
Jeffrey Pfau jeffrey@endrift.com
Thu, 17 Jul 2014 02:55:13 -0700
1 files changed,
5 insertions(+),
1 deletions(-)
jump to
M
src/gba/gba-thread.c
→
src/gba/gba-thread.c
@@ -201,7 +201,7 @@ } else {
threadContext->rewindBuffer = 0; } - if (!GBAIsROM(threadContext->rom)) { + if (threadContext->rom && !GBAIsROM(threadContext->rom)) { threadContext->rom->close(threadContext->rom); threadContext->rom = 0; }@@ -224,6 +224,10 @@ vf->close(vf);
} dirent = threadContext->gamedir->listNext(threadContext->gamedir); } + } + + if (!threadContext->rom) { + return false; } if (threadContext->fname && !threadContext->save) {