summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMorph <39850852+Morph1984@users.noreply.github.com>2020-10-13 06:57:04 +0200
committerMorph <39850852+Morph1984@users.noreply.github.com>2020-10-13 06:57:04 +0200
commit8db3feae19e6dcaad3490ace14b0b842d9eb758f (patch)
tree45d7ae78a3e913d3fa2e7295bc73590cc438fea3 /src
parentMerge pull request #3929 from FearlessTobi/ticket-keys (diff)
downloadyuzu-8db3feae19e6dcaad3490ace14b0b842d9eb758f.tar
yuzu-8db3feae19e6dcaad3490ace14b0b842d9eb758f.tar.gz
yuzu-8db3feae19e6dcaad3490ace14b0b842d9eb758f.tar.bz2
yuzu-8db3feae19e6dcaad3490ace14b0b842d9eb758f.tar.lz
yuzu-8db3feae19e6dcaad3490ace14b0b842d9eb758f.tar.xz
yuzu-8db3feae19e6dcaad3490ace14b0b842d9eb758f.tar.zst
yuzu-8db3feae19e6dcaad3490ace14b0b842d9eb758f.zip
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/service/filesystem/filesystem.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/core/hle/service/filesystem/filesystem.cpp b/src/core/hle/service/filesystem/filesystem.cpp
index 54a5fb84b..3cdef4888 100644
--- a/src/core/hle/service/filesystem/filesystem.cpp
+++ b/src/core/hle/service/filesystem/filesystem.cpp
@@ -79,7 +79,7 @@ ResultCode VfsDirectoryServiceWrapper::DeleteFile(const std::string& path_) cons
}
auto dir = GetDirectoryRelativeWrapped(backing, Common::FS::GetParentPath(path));
- if (dir->GetFile(Common::FS::GetFilename(path)) == nullptr) {
+ if (dir == nullptr || dir->GetFile(Common::FS::GetFilename(path)) == nullptr) {
return FileSys::ERROR_PATH_NOT_FOUND;
}
if (!dir->DeleteFile(Common::FS::GetFilename(path))) {
@@ -93,8 +93,9 @@ ResultCode VfsDirectoryServiceWrapper::DeleteFile(const std::string& path_) cons
ResultCode VfsDirectoryServiceWrapper::CreateDirectory(const std::string& path_) const {
std::string path(Common::FS::SanitizePath(path_));
auto dir = GetDirectoryRelativeWrapped(backing, Common::FS::GetParentPath(path));
- if (dir == nullptr && Common::FS::GetFilename(Common::FS::GetParentPath(path)).empty())
+ if (dir == nullptr || Common::FS::GetFilename(Common::FS::GetParentPath(path)).empty()) {
dir = backing;
+ }
auto new_dir = dir->CreateSubdirectory(Common::FS::GetFilename(path));
if (new_dir == nullptr) {
// TODO(DarkLordZach): Find a better error code for this