Core: Fix crash if cheat autosave fails
Vicki Pfau vi@endrift.com
Sun, 14 Jan 2018 19:24:24 -0800
1 files changed,
3 insertions(+),
0 deletions(-)
jump to
M
src/core/cheats.c
→
src/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); }