diff --git a/code/Common/Subdivision.cpp b/code/Common/Subdivision.cpp index fc8ab20991..78c249807d 100644 --- a/code/Common/Subdivision.cpp +++ b/code/Common/Subdivision.cpp @@ -524,7 +524,11 @@ void CatmullClarkSubdivider::InternSubdivide( } } - ai_assert(adj[o] - moffsets[nidx].first < mp->mNumFaces); + if (mp == nullptr) { + continue; + } + + ai_assert(adj[o] - moffsets[nidx].first < mp->mNumFaces); const aiFace &f = mp->mFaces[adj[o] - moffsets[nidx].first]; bool haveit = false;