aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--backends/saves/default/default-saves.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/backends/saves/default/default-saves.cpp b/backends/saves/default/default-saves.cpp
index 8973101a5a..44fd48bb7e 100644
--- a/backends/saves/default/default-saves.cpp
+++ b/backends/saves/default/default-saves.cpp
@@ -169,6 +169,8 @@ Common::OutSaveFile *DefaultSaveFileManager::openForSaving(const Common::String
// Open the file for saving.
Common::WriteStream *const sf = fileNode.createWriteStream();
+ if (!sf)
+ return nullptr;
Common::OutSaveFile *const result = new Common::OutSaveFile(compress ? Common::wrapCompressedWriteStream(sf) : sf);
// Add file to cache now that it exists.