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;
}
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);
}