Cheats: Fix crash on parsing invalid cheat
This commit is contained in:
parent
24f15acf6c
commit
218df625df
|
@ -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();
|
||||||
|
|
Loading…
Reference in New Issue