diff --git a/code/PostProcessing/SortByPTypeProcess.cpp b/code/PostProcessing/SortByPTypeProcess.cpp index 48ebbc573..3de1818ff 100644 --- a/code/PostProcessing/SortByPTypeProcess.cpp +++ b/code/PostProcessing/SortByPTypeProcess.cpp @@ -167,6 +167,10 @@ void SortByPTypeProcess::Execute(aiScene *pScene) { // with the largest number of primitives unsigned int aiNumPerPType[4] = { 0, 0, 0, 0 }; aiFace *pFirstFace = mesh->mFaces; + if (!pFirstFace) { + continue; + } + aiFace *const pLastFace = pFirstFace + mesh->mNumFaces; unsigned int numPolyVerts = 0;