Added check against null

This commit is contained in:
Robert Osfield
2016-06-27 10:30:15 +01:00
parent f65048410c
commit 760794eff3
2 changed files with 4 additions and 0 deletions

View File

@@ -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<osg::DrawElements*>( prim ), *geom, node );
}
else
{
std::string warning( "fltexp: Unknown PrimitiveSet type." );

View File

@@ -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 );