From 8589d595208324a8d0db8734e6c707d929981b9d Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 29 Jun 2016 17:35:20 +0100 Subject: [PATCH] Added handling of null pointer --- src/osgPlugins/gles/GeometrySplitterVisitor | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/osgPlugins/gles/GeometrySplitterVisitor b/src/osgPlugins/gles/GeometrySplitterVisitor index ba64d9692..da7ce1b5f 100644 --- a/src/osgPlugins/gles/GeometrySplitterVisitor +++ b/src/osgPlugins/gles/GeometrySplitterVisitor @@ -285,11 +285,13 @@ protected: return; } - for(unsigned int i = 0 ; i < lines.size() ; ++ i) { + for(unsigned int i = 0 ; i < lines.size() ; ++ i) + { const osg::DrawElementsUInt* line = dynamic_cast(lines[i].get()); - if(!line || line->getMode() != osg::PrimitiveSet::LINES) { - osg::notify(osg::INFO) << "Primitive with bad mode flagged as wireframe. Skipping." - << std::endl; + if(!line || line->getMode() != osg::PrimitiveSet::LINES) + { + osg::notify(osg::INFO) << "Primitive with bad mode flagged as wireframe. Skipping."<< std::endl; + continue; } osg::ref_ptr small = new osg::DrawElementsUInt(osg::PrimitiveSet::LINES); osg::ref_ptr large = new osg::DrawElementsUInt(osg::PrimitiveSet::LINES);