From fec64f6d8cb7917ecf96aae51463504b5c5b4f28 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 30 Jun 2016 08:23:51 +0100 Subject: [PATCH] Added handling of NULL pointer case --- src/osgPlugins/md2/ReaderWriterMD2.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/osgPlugins/md2/ReaderWriterMD2.cpp b/src/osgPlugins/md2/ReaderWriterMD2.cpp index e9d92c314..65dab9078 100644 --- a/src/osgPlugins/md2/ReaderWriterMD2.cpp +++ b/src/osgPlugins/md2/ReaderWriterMD2.cpp @@ -374,8 +374,12 @@ load_md2 (const char *filename, const osgDB::ReaderWriter::Options* options) osg::ref_ptr geode = new osg::Geode; geode->addDrawable (geom.get()); - current_sequence->addChild (geode.get()); - current_sequence->setTime (sequence_frame, 0.2f); + if (current_sequence) + { + current_sequence->addChild (geode.get()); + current_sequence->setTime (sequence_frame, 0.2f); + } + sequence_frame++; last_frame_name = frame->name;