From ed7c4af915744631e3e7e5646756199e192eaad5 Mon Sep 17 00:00:00 2001 From: Liam Date: Tue, 13 Jun 2023 17:22:47 -0400 Subject: [PATCH] vfs_real: require file existence on open --- src/core/file_sys/vfs_real.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/core/file_sys/vfs_real.cpp b/src/core/file_sys/vfs_real.cpp index 13f93eecd..7a15d8438 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(); this->InsertReferenceIntoList(*reference);