From 3a376a0cd9eb01fa2a1427bc88fb4e59e26cb9fb Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sun, 23 Mar 2014 13:01:52 -0700 Subject: [PATCH] Fix exists check in VFSFileSystem::GetFileInfo(). Only matters if it can't map the path / doesn't have the apk mapped (e.g. as on headless right now.) --- Core/FileSystems/DirectoryFileSystem.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Core/FileSystems/DirectoryFileSystem.cpp b/Core/FileSystems/DirectoryFileSystem.cpp index 84a3e5ecca..80668f3cd6 100644 --- a/Core/FileSystems/DirectoryFileSystem.cpp +++ b/Core/FileSystems/DirectoryFileSystem.cpp @@ -833,11 +833,14 @@ PSPFileInfo VFSFileSystem::GetFileInfo(std::string filename) { std::string fullName = GetLocalPath(filename); INFO_LOG(FILESYS,"Getting VFS file info %s (%s)", fullName.c_str(), filename.c_str()); FileInfo fo; - VFSGetFileInfo(fullName.c_str(), &fo); - x.exists = fo.exists; - if (x.exists) { - x.size = fo.size; - x.type = fo.isDirectory ? FILETYPE_DIRECTORY : FILETYPE_NORMAL; + if (VFSGetFileInfo(fullName.c_str(), &fo)) { + x.exists = fo.exists; + if (x.exists) { + x.size = fo.size; + x.type = fo.isDirectory ? FILETYPE_DIRECTORY : FILETYPE_NORMAL; + } + } else { + x.exists = false; } INFO_LOG(FILESYS,"Got VFS file info: size = %i", (int)x.size); return x;