From 760794eff3e378899d7b6e748100c699e0635be1 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Mon, 27 Jun 2016 10:30:15 +0100 Subject: [PATCH] Added check against null --- src/osgPlugins/OpenFlight/FltExportVisitor.cpp | 2 ++ src/osgPlugins/OpenFlight/expGeometryRecords.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/osgPlugins/OpenFlight/FltExportVisitor.cpp b/src/osgPlugins/OpenFlight/FltExportVisitor.cpp index 04fecda4d..dbf53f739 100644 --- a/src/osgPlugins/OpenFlight/FltExportVisitor.cpp +++ b/src/osgPlugins/OpenFlight/FltExportVisitor.cpp @@ -425,7 +425,9 @@ FltExportVisitor::apply( osg::Geode& node ) else if ( (prim->getType() == osg::PrimitiveSet::DrawElementsUBytePrimitiveType) || (prim->getType() == osg::PrimitiveSet::DrawElementsUShortPrimitiveType) || (prim->getType() == osg::PrimitiveSet::DrawElementsUIntPrimitiveType) ) + { handleDrawElements( dynamic_cast( prim ), *geom, node ); + } else { std::string warning( "fltexp: Unknown PrimitiveSet type." ); diff --git a/src/osgPlugins/OpenFlight/expGeometryRecords.cpp b/src/osgPlugins/OpenFlight/expGeometryRecords.cpp index 8198db440..b153e5a7b 100644 --- a/src/osgPlugins/OpenFlight/expGeometryRecords.cpp +++ b/src/osgPlugins/OpenFlight/expGeometryRecords.cpp @@ -1044,6 +1044,8 @@ FltExportVisitor::handleDrawArrayLengths( const osg::DrawArrayLengths* dal, cons void FltExportVisitor::handleDrawElements( const osg::DrawElements* de, const osg::Geometry& geom, const osg::Geode& geode ) { + if (!de) return; + GLenum mode = de->getMode(); int n( 0 );