From 1c2aeb3138148c6d4ee38b3eade4b36140eb46f4 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 30 Jun 2016 08:13:01 +0100 Subject: [PATCH] Added handling of NULL --- src/osgPlugins/txp/TXPArchive.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/osgPlugins/txp/TXPArchive.cpp b/src/osgPlugins/txp/TXPArchive.cpp index e53bd5572..967dd3761 100644 --- a/src/osgPlugins/txp/TXPArchive.cpp +++ b/src/osgPlugins/txp/TXPArchive.cpp @@ -154,8 +154,12 @@ bool TXPArchive::loadMaterial(int ix) osg::StateSet* osg_state_set = new osg::StateSet; - const trpgMaterial *mat; - mat = materialTable.GetMaterialRef(0,i); + const trpgMaterial* mat = materialTable.GetMaterialRef(0,i); + if (!mat) + { + OSG_WARN<<"TXPArchive::loadMaterial("<