vfs_real: require file existence on open

merge-requests/60/head
Liam 2023-06-13 17:22:47 +07:00
parent dbbe237668
commit ed7c4af915
1 changed files with 4 additions and 0 deletions

@ -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>(); auto reference = std::make_unique<FileReference>();
this->InsertReferenceIntoList(*reference); this->InsertReferenceIntoList(*reference);