aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMerry <git@mary.rs>2022-09-25 19:31:35 +0100
committerMerry <git@mary.rs>2022-09-25 19:31:35 +0100
commitf55ed1cab0de61c40455afd680cd878d88ece977 (patch)
treef808d5e8ca4c4502d83914a8028bd04d0bf81a9a /src
parent465c46387d38c9fd0c14ad856fb22edb7c2858d7 (diff)
core/loader: Return nullptr if file is nullptr
Diffstat (limited to 'src')
-rw-r--r--src/core/loader/loader.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/core/loader/loader.cpp b/src/core/loader/loader.cpp
index 104d16efa2..f24474ed86 100644
--- a/src/core/loader/loader.cpp
+++ b/src/core/loader/loader.cpp
@@ -244,6 +244,10 @@ static std::unique_ptr<AppLoader> GetFileLoader(Core::System& system, FileSys::V
std::unique_ptr<AppLoader> GetLoader(Core::System& system, FileSys::VirtualFile file,
u64 program_id, std::size_t program_index) {
+ if (!file) {
+ return nullptr;
+ }
+
FileType type = IdentifyFile(file);
const FileType filename_type = GuessFromFilename(file->GetName());