aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/fullpipe/statesaver.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/engines/fullpipe/statesaver.cpp b/engines/fullpipe/statesaver.cpp
index eb5de08422..c6f4851a44 100644
--- a/engines/fullpipe/statesaver.cpp
+++ b/engines/fullpipe/statesaver.cpp
@@ -105,6 +105,11 @@ void GameLoader::writeSavegame(Scene *sc, const char *fname) {
// Now dump it into save file
Common::OutSaveFile *saveFile = g_system->getSavefileManager()->openForSaving(fname);
+ if (!saveFile) {
+ warning("Cannot open file for writing: %s", fname);
+ return;
+ }
+
saveFile->writeUint32LE(header.version);
saveFile->write(header.magic, 32);
saveFile->writeUint32LE(header.updateCounter);