all repos — mgba @ 199e3ef4ada7a49b400c5d613ad0522c6c8e427f

mGBA Game Boy Advance Emulator

Core: Fix crash if cheat autosave fails
Vicki Pfau vi@endrift.com
Sun, 14 Jan 2018 19:24:24 -0800
commit

199e3ef4ada7a49b400c5d613ad0522c6c8e427f

parent

d30d89245229b18be0c4ed92323a730becb2a77d

1 files changed, 3 insertions(+), 0 deletions(-)

jump to
M src/core/cheats.csrc/core/cheats.c

@@ -260,6 +260,9 @@ if (!device->autosave) {

return; } struct VFile* vf = mDirectorySetOpenSuffix(&device->p->dirs, device->p->dirs.cheats, ".cheats", O_WRONLY | O_CREAT | O_TRUNC); + if (!vf) { + return; + } mCheatSaveFile(device, vf); vf->close(vf); }