Browse Source

Merge pull request #1738 from assimp/issue_1728

closes https://github.com/assimp/assimp/issues/1728: check if mesh is…
Kim Kulling 7 năm trước cách đây
mục cha
commit
39ce3e1309
1 tập tin đã thay đổi với 4 bổ sung0 xóa
  1. 4 0
      code/XFileImporter.cpp

+ 4 - 0
code/XFileImporter.cpp

@@ -246,6 +246,10 @@ void XFileImporter::CreateMeshes( aiScene* pScene, aiNode* pNode, const std::vec
     for( unsigned int a = 0; a < pMeshes.size(); a++)
     {
         XFile::Mesh* sourceMesh = pMeshes[a];
+        if ( nullptr == sourceMesh ) {
+            continue;
+        }
+
         // first convert its materials so that we can find them with their index afterwards
         ConvertMaterials( pScene, sourceMesh->mMaterials);