1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-02-05 15:40:10 +00:00

Merge pull request #2998 from akortunov/crashfix

Avoid crash when object paging encounters an empty shape
This commit is contained in:
Bret Curtis 2020-09-01 10:35:34 +02:00 committed by GitHub
commit 009c18a97d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -289,7 +289,9 @@ namespace MWRender
} }
virtual void apply(osg::Geometry& geom) virtual void apply(osg::Geometry& geom)
{ {
mResult.mNumVerts += geom.getVertexArray()->getNumElements(); if (osg::Array* array = geom.getVertexArray())
mResult.mNumVerts += array->getNumElements();
++mResult.mStateSetCounter[mCurrentStateSet]; ++mResult.mStateSetCounter[mCurrentStateSet];
++mGlobalStateSetCounter[mCurrentStateSet]; ++mGlobalStateSetCounter[mCurrentStateSet];
} }