aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--backends/saves/default/default-saves.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/backends/saves/default/default-saves.cpp b/backends/saves/default/default-saves.cpp
index e9a4165ddb..17e888175c 100644
--- a/backends/saves/default/default-saves.cpp
+++ b/backends/saves/default/default-saves.cpp
@@ -63,7 +63,9 @@ DefaultSaveFileManager::DefaultSaveFileManager(const Common::String &defaultSave
void DefaultSaveFileManager::checkPath(const Common::FSNode &dir) {
clearError();
if (!dir.exists()) {
- setError(Common::kPathDoesNotExist, "The savepath '"+dir.getPath()+"' does not exist");
+ if (!dir.createDirectory()) {
+ setError(Common::kPathDoesNotExist, "Failed to create directory '"+dir.getPath()+"'");
+ }
} else if (!dir.isDirectory()) {
setError(Common::kPathNotDirectory, "The savepath '"+dir.getPath()+"' is not a directory");
}