closes https://github.com/assimp/assimp/issues/1728: check if mesh is a null instance before dereferencing it.

pull/1738/head
Kim Kulling 2018-01-24 21:43:36 +01:00
parent f80dbe2046
commit 5baba37414
1 changed files with 4 additions and 0 deletions

View File

@ -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);