Cheats: Fix crash on parsing invalid cheat

This commit is contained in:
Stenzek 2024-10-27 12:32:09 +10:00
parent 24f15acf6c
commit 218df625df
No known key found for this signature in database
1 changed files with 1 additions and 1 deletions

View File

@ -1994,7 +1994,7 @@ std::unique_ptr<Cheats::GamesharkCheatCode> Cheats::GamesharkCheatCode::Parse(Me
code->instructions.push_back(inst); code->instructions.push_back(inst);
} }
if (code->instructions.empty()) if (code && code->instructions.empty())
{ {
Error::SetStringFmt(error, "No instructions in code."); Error::SetStringFmt(error, "No instructions in code.");
code.reset(); code.reset();