From dee703a6f374aee5fea1095e4255e5c2f0fc6b0b Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Tue, 6 Jan 2009 16:35:38 +0000 Subject: [PATCH] From Ewe Woesnner, "the Inventor loader crashes when a texture could not be loaded. Please find attached a small fix which solves this issue." --- src/osgPlugins/Inventor/ConvertFromInventor.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/osgPlugins/Inventor/ConvertFromInventor.cpp b/src/osgPlugins/Inventor/ConvertFromInventor.cpp index 0140598c8..b914e859d 100644 --- a/src/osgPlugins/Inventor/ConvertFromInventor.cpp +++ b/src/osgPlugins/Inventor/ConvertFromInventor.cpp @@ -570,10 +570,12 @@ ConvertFromInventor::getStateSet(SoCallbackAction* action) stateSet->setTextureAttributeAndModes(0, texture.get(), osg::StateAttribute::ON); // propogate name - std::string name = texture->getName(); - if (name != "") - stateSet->setName(name); - + if(texture.valid()) + { + std::string name = texture->getName(); + if (name != "") + stateSet->setName(name); + } // Set the texture environment osg::ref_ptr texEnv = new osg::TexEnv; switch (action->getTextureModel())