mirror of https://github.com/mgba-emu/mgba.git
Don't crash if no ROM is loaded
This commit is contained in:
parent
74fcdf54e0
commit
2367abe67d
|
@ -201,7 +201,7 @@ bool GBAThreadStart(struct GBAThread* threadContext) {
|
|||
threadContext->rewindBuffer = 0;
|
||||
}
|
||||
|
||||
if (!GBAIsROM(threadContext->rom)) {
|
||||
if (threadContext->rom && !GBAIsROM(threadContext->rom)) {
|
||||
threadContext->rom->close(threadContext->rom);
|
||||
threadContext->rom = 0;
|
||||
}
|
||||
|
@ -226,6 +226,10 @@ bool GBAThreadStart(struct GBAThread* threadContext) {
|
|||
}
|
||||
}
|
||||
|
||||
if (!threadContext->rom) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (threadContext->fname && !threadContext->save) {
|
||||
char* savedata = 0;
|
||||
char* dotPoint = strrchr(threadContext->fname, '.');
|
||||
|
|
Loading…
Reference in New Issue