From 5baba374147de5f701a3685c1dc836e239214ea2 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Wed, 24 Jan 2018 21:43:36 +0100 Subject: [PATCH] closes https://github.com/assimp/assimp/issues/1728: check if mesh is a null instance before dereferencing it. --- code/XFileImporter.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/code/XFileImporter.cpp b/code/XFileImporter.cpp index 75be90310..6d1316194 100644 --- a/code/XFileImporter.cpp +++ b/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);