yuzu-emu
/
yuzu-mainline
Archived
1
0
Fork 0

Add comment to clarify the nullptr check

This commit is contained in:
Morph 2020-07-15 13:08:04 -04:00
parent 2079bb4090
commit 5892fc1555
1 changed files with 1 additions and 0 deletions

View File

@ -55,6 +55,7 @@ std::string VfsDirectoryServiceWrapper::GetName() const {
ResultCode VfsDirectoryServiceWrapper::CreateFile(const std::string& path_, u64 size) const { ResultCode VfsDirectoryServiceWrapper::CreateFile(const std::string& path_, u64 size) const {
std::string path(FileUtil::SanitizePath(path_)); std::string path(FileUtil::SanitizePath(path_));
auto dir = GetDirectoryRelativeWrapped(backing, FileUtil::GetParentPath(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) { if (dir == nullptr) {
dir = backing->CreateSubdirectory(FileUtil::GetParentPath(path)); dir = backing->CreateSubdirectory(FileUtil::GetParentPath(path));
} }