From 98e42e22b8a922f96d5088db889d98bdd02129d9 Mon Sep 17 00:00:00 2001 From: Evangel Date: Sun, 22 Nov 2020 15:49:41 +1000 Subject: [PATCH] Added check around setting pScene->mName from asset.scene. --- code/AssetLib/glTF2/glTF2Importer.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/code/AssetLib/glTF2/glTF2Importer.cpp b/code/AssetLib/glTF2/glTF2Importer.cpp index ad0cea221..738186414 100644 --- a/code/AssetLib/glTF2/glTF2Importer.cpp +++ b/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