Core: Only attempt to open BIOS if the path is non-null

This commit is contained in:
Vicki Pfau 2017-03-20 17:37:20 -07:00
parent af2db9073c
commit 91c0f95e5f
2 changed files with 6 additions and 2 deletions

View File

@ -275,7 +275,9 @@ static void _GBCoreReset(struct mCore* core) {
default: default:
break; break;
}; };
bios = VFileOpen(configPath, O_RDONLY); if (configPath) {
bios = VFileOpen(configPath, O_RDONLY);
}
if (bios && GBIsBIOS(bios)) { if (bios && GBIsBIOS(bios)) {
found = true; found = true;
} else if (bios) { } else if (bios) {

View File

@ -303,7 +303,9 @@ static void _GBACoreReset(struct mCore* core) {
} }
if (!found) { if (!found) {
const char* configPath = mCoreConfigGetValue(&core->config, "gba.bios"); const char* configPath = mCoreConfigGetValue(&core->config, "gba.bios");
bios = VFileOpen(configPath, O_RDONLY); if (configPath) {
bios = VFileOpen(configPath, O_RDONLY);
}
if (bios && GBAIsBIOS(bios)) { if (bios && GBAIsBIOS(bios)) {
found = true; found = true;
} else if (bios) { } else if (bios) {