Permalink
Browse files

Core: Fix crash if cheat autosave fails

  • Loading branch information...
endrift committed Jan 15, 2018
1 parent d30d892 commit 199e3ef4ada7a49b400c5d613ad0522c6c8e427f
Showing with 3 additions and 0 deletions.
  1. +3 −0 src/core/cheats.c
View
@@ -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);
}

0 comments on commit 199e3ef

Please sign in to comment.