Explorar o código

Added check around setting pScene->mName from asset.scene.

Evangel %!s(int64=4) %!d(string=hai) anos
pai
achega
98e42e22b8
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      code/AssetLib/glTF2/glTF2Importer.cpp

+ 3 - 1
code/AssetLib/glTF2/glTF2Importer.cpp

@@ -1386,7 +1386,9 @@ void glTF2Importer::InternReadFile(const std::string &pFile, aiScene *pScene, IO
     // read the asset file
     glTF2::Asset asset(pIOHandler);
     asset.Load(pFile, GetExtension(pFile) == "glb");
-    pScene->mName = asset.scene->name;
+    if (asset.scene) {
+        pScene->mName = asset.scene->name;
+    }
 
     //
     // Copy the data out