Core: Fix crash if cheat autosave fails

This commit is contained in:
Vicki Pfau 2018-01-14 19:24:24 -08:00
parent d30d892452
commit 199e3ef4ad
1 changed files with 3 additions and 0 deletions

View File

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