diff --git a/Source/Core/Core/IOS/FS/HostBackend/File.cpp b/Source/Core/Core/IOS/FS/HostBackend/File.cpp index 9f58c2fffa..1379ebc049 100644 --- a/Source/Core/Core/IOS/FS/HostBackend/File.cpp +++ b/Source/Core/Core/IOS/FS/HostBackend/File.cpp @@ -81,6 +81,12 @@ Result HostFileSystem::OpenFile(Uid, Gid, const std::string& path, M return ResultCode::NoFreeHandle; const std::string host_path = BuildFilename(path).host_path; + if (File::IsDirectory(host_path)) + { + *handle = Handle{}; + return ResultCode::Invalid; + } + if (!File::IsFile(host_path)) { *handle = Handle{};