瀏覽代碼

Update DefaultIOSystem.cpp (#5697)

- closes https://github.com/assimp/assimp/issues/5678
Kim Kulling 1 年之前
父節點
當前提交
a37d748c17
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      code/Common/DefaultIOSystem.cpp

+ 4 - 0
code/Common/DefaultIOSystem.cpp

@@ -93,6 +93,10 @@ static std::string WideToUtf8(const wchar_t *in) {
 // ------------------------------------------------------------------------------------------------
 // Tests for the existence of a file at the given path.
 bool DefaultIOSystem::Exists(const char *pFile) const {
+    if (pFile == nullptr) {
+        return false;
+    }
+        
 #ifdef _WIN32
     struct __stat64 filestat;
     if (_wstat64(Utf8ToWide(pFile).c_str(), &filestat) != 0) {