summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorLiam <byteslice@airmail.cc>2023-08-08 22:12:04 +0200
committerLiam <byteslice@airmail.cc>2023-08-08 22:12:04 +0200
commit1e394c6cdf1ab83c83477c19c0e736a95b86e8da (patch)
tree1b6abcfa5a6be2e55de9e7dee6c19f8cb032f20c /src/core
parentgeneral: fix incorrect conversions (diff)
downloadyuzu-1e394c6cdf1ab83c83477c19c0e736a95b86e8da.tar
yuzu-1e394c6cdf1ab83c83477c19c0e736a95b86e8da.tar.gz
yuzu-1e394c6cdf1ab83c83477c19c0e736a95b86e8da.tar.bz2
yuzu-1e394c6cdf1ab83c83477c19c0e736a95b86e8da.tar.lz
yuzu-1e394c6cdf1ab83c83477c19c0e736a95b86e8da.tar.xz
yuzu-1e394c6cdf1ab83c83477c19c0e736a95b86e8da.tar.zst
yuzu-1e394c6cdf1ab83c83477c19c0e736a95b86e8da.zip
Diffstat (limited to '')
-rw-r--r--src/core/hle/service/filesystem/filesystem.cpp28
1 files changed, 24 insertions, 4 deletions
diff --git a/src/core/hle/service/filesystem/filesystem.cpp b/src/core/hle/service/filesystem/filesystem.cpp
index f59fa7fb1..ac465d5a9 100644
--- a/src/core/hle/service/filesystem/filesystem.cpp
+++ b/src/core/hle/service/filesystem/filesystem.cpp
@@ -383,7 +383,12 @@ Result FileSystemController::CreateSaveData(FileSys::VirtualDir* out_save_data,
return FileSys::ERROR_ENTITY_NOT_FOUND;
}
- *out_save_data = save_data_factory->Create(space, save_struct);
+ auto save_data = save_data_factory->Create(space, save_struct);
+ if (save_data == nullptr) {
+ return FileSys::ERROR_ENTITY_NOT_FOUND;
+ }
+
+ *out_save_data = save_data;
return ResultSuccess;
}
@@ -397,7 +402,12 @@ Result FileSystemController::OpenSaveData(FileSys::VirtualDir* out_save_data,
return FileSys::ERROR_ENTITY_NOT_FOUND;
}
- *out_save_data = save_data_factory->Open(space, attribute);
+ auto save_data = save_data_factory->Open(space, attribute);
+ if (save_data == nullptr) {
+ return FileSys::ERROR_ENTITY_NOT_FOUND;
+ }
+
+ *out_save_data = save_data;
return ResultSuccess;
}
@@ -409,7 +419,12 @@ Result FileSystemController::OpenSaveDataSpace(FileSys::VirtualDir* out_save_dat
return FileSys::ERROR_ENTITY_NOT_FOUND;
}
- *out_save_data_space = save_data_factory->GetSaveDataSpaceDirectory(space);
+ auto save_data_space = save_data_factory->GetSaveDataSpaceDirectory(space);
+ if (save_data_space == nullptr) {
+ return FileSys::ERROR_ENTITY_NOT_FOUND;
+ }
+
+ *out_save_data_space = save_data_space;
return ResultSuccess;
}
@@ -420,7 +435,12 @@ Result FileSystemController::OpenSDMC(FileSys::VirtualDir* out_sdmc) const {
return FileSys::ERROR_SD_CARD_NOT_FOUND;
}
- *out_sdmc = sdmc_factory->Open();
+ auto sdmc = sdmc_factory->Open();
+ if (sdmc == nullptr) {
+ return FileSys::ERROR_SD_CARD_NOT_FOUND;
+ }
+
+ *out_sdmc = sdmc;
return ResultSuccess;
}