Skip to content

Commit

Permalink
Fix crash when loading a ROM with slot 2 set to load a GBA ROM but no…
Browse files Browse the repository at this point in the history
… GBA ROM was provided
  • Loading branch information
rafaelvcaetano committed Jun 27, 2024
1 parent 0a3ee93 commit ceb611e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/src/main/cpp/MelonDSAndroidJNI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -479,11 +479,11 @@ Java_me_magnum_melonds_MelonEmulator_updateEmulatorConfiguration(JNIEnv* env, jo

MelonDSAndroid::RomGbaSlotConfig* buildGbaSlotConfig(GbaSlotType slotType, const char* romPath, const char* savePath)
{
if (slotType == GbaSlotType::GBA_ROM)
if (slotType == GbaSlotType::GBA_ROM && romPath != nullptr)
{
MelonDSAndroid::RomGbaSlotConfigGbaRom* gbaSlotConfigGbaRom = new MelonDSAndroid::RomGbaSlotConfigGbaRom {
.romPath = std::string(romPath),
.savePath = std::string(savePath)
.savePath = savePath ? std::string(savePath) : "",
};
return (MelonDSAndroid::RomGbaSlotConfig*) gbaSlotConfigGbaRom;
}
Expand Down

0 comments on commit ceb611e

Please sign in to comment.