소스 검색

Add comment to clarify the nullptr check

Morph 6 년 전
부모
커밋
5892fc1555
1개의 변경된 파일1개의 추가작업 그리고 0개의 파일을 삭제
  1. 1 0
      src/core/hle/service/filesystem/filesystem.cpp

+ 1 - 0
src/core/hle/service/filesystem/filesystem.cpp

@@ -55,6 +55,7 @@ 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));
     }