diff options
author | bunnei <bunneidev@gmail.com> | 2020-07-18 06:59:26 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-18 06:59:26 +0200 |
commit | c700079e0815055df43bf0a337e9c562fb76d205 (patch) | |
tree | 03065d2091f44a6b55838d9b10e9d1904f64c941 /src/core/hle | |
parent | Merge pull request #4273 from ogniK5377/async-shaders-prod (diff) | |
parent | Add comment to clarify the nullptr check (diff) | |
download | yuzu-c700079e0815055df43bf0a337e9c562fb76d205.tar yuzu-c700079e0815055df43bf0a337e9c562fb76d205.tar.gz yuzu-c700079e0815055df43bf0a337e9c562fb76d205.tar.bz2 yuzu-c700079e0815055df43bf0a337e9c562fb76d205.tar.lz yuzu-c700079e0815055df43bf0a337e9c562fb76d205.tar.xz yuzu-c700079e0815055df43bf0a337e9c562fb76d205.tar.zst yuzu-c700079e0815055df43bf0a337e9c562fb76d205.zip |
Diffstat (limited to 'src/core/hle')
-rw-r--r-- | src/core/hle/service/filesystem/filesystem.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/core/hle/service/filesystem/filesystem.cpp b/src/core/hle/service/filesystem/filesystem.cpp index cadc03805..c66124998 100644 --- a/src/core/hle/service/filesystem/filesystem.cpp +++ b/src/core/hle/service/filesystem/filesystem.cpp @@ -55,6 +55,10 @@ std::string VfsDirectoryServiceWrapper::GetName() const { ResultCode VfsDirectoryServiceWrapper::CreateFile(const std::string& path_, u64 size) const { std::string path(FileUtil::SanitizePath(path_)); auto dir = GetDirectoryRelativeWrapped(backing, FileUtil::GetParentPath(path)); + // dir can be nullptr if path contains subdirectories, create those prior to creating the file. + if (dir == nullptr) { + dir = backing->CreateSubdirectory(FileUtil::GetParentPath(path)); + } auto file = dir->CreateFile(FileUtil::GetFilename(path)); if (file == nullptr) { // TODO(DarkLordZach): Find a better error code for this |