Skip to content

VERY experimental Nintendo Switch 2 emulator

C++

vfs_real: require file existence on open

Liam863d5c23d081
diff --git a/src/core/file_sys/vfs_real.cpp b/src/core/file_sys/vfs_real.cpp
index 13f93eecd1..7a15d8438d 100644
--- a/src/core/file_sys/vfs_real.cpp
+++ b/src/core/file_sys/vfs_real.cpp
@@ -81,6 +81,10 @@ VirtualFile RealVfsFilesystem::OpenFile(std::string_view path_, Mode perms) {
}
}
+ if (!FS::Exists(path) || !FS::IsFile(path)) {
+ return nullptr;
+ }
+
auto reference = std::make_unique<FileReference>();
this->InsertReferenceIntoList(*reference);