diff --git a/components/sceneutil/pathgridutil.cpp b/components/sceneutil/pathgridutil.cpp index b4de250e77..121ef068d8 100644 --- a/components/sceneutil/pathgridutil.cpp +++ b/components/sceneutil/pathgridutil.cpp @@ -126,9 +126,9 @@ namespace SceneUtil gridGeometry->setVertexArray(vertices); gridGeometry->setColorArray(colors, osg::Array::BIND_PER_VERTEX); - if (pointIndexCount) + if (!pointIndices->empty()) gridGeometry->addPrimitiveSet(pointIndices); - if (edgeIndexCount) + if (!lineIndices->empty()) gridGeometry->addPrimitiveSet(lineIndices); gridGeometry->getOrCreateStateSet()->setMode(GL_LIGHTING, osg::StateAttribute::OFF); }