diff --git a/tools/assimp_view/MeshRenderer.cpp b/tools/assimp_view/MeshRenderer.cpp index 0efcf8a20..9c81d3ad9 100644 --- a/tools/assimp_view/MeshRenderer.cpp +++ b/tools/assimp_view/MeshRenderer.cpp @@ -85,6 +85,9 @@ int CMeshRenderer::DrawSorted(unsigned int iIndex,const aiMatrix4x4& mWorld) AssetHelper::MeshHelper* pcHelper = g_pcAsset->apcMeshes[iIndex]; const aiMesh* pcMesh = g_pcAsset->pcScene->mMeshes[iIndex]; + if (!pcHelper || !pcMesh || !pcHelper->piIB) + return -5; + if (pcMesh->mPrimitiveTypes != aiPrimitiveType_TRIANGLE) return DrawUnsorted(iIndex); if (pcMesh->HasBones())