From 4845fe23aec146b63ae92dac72c4bc7129f4b3dc Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 12 Jun 2009 09:57:45 +0000 Subject: [PATCH] From Laurens Voerman, "there seems to be a bug in the proxynode writer introduced in svn rev 10330. It craches on a null pointer for options (on my windows system). Fixed version of the file "src\osgPlugins\osg\ProxyNode.cpp" attached, based on svn rev 10332." --- src/osgPlugins/osg/ProxyNode.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/osgPlugins/osg/ProxyNode.cpp b/src/osgPlugins/osg/ProxyNode.cpp index 2f953cfe0..25268bd4f 100644 --- a/src/osgPlugins/osg/ProxyNode.cpp +++ b/src/osgPlugins/osg/ProxyNode.cpp @@ -164,15 +164,17 @@ bool ProxyNode_writeLocalData(const Object& obj, Output& fw) bool includeExternalReferences = false; bool useOriginalExternalReferences = true; bool writeExternalReferenceFiles = false; - std::string optionsString = fw.getOptions()->getOptionString(); - includeExternalReferences = optionsString.find("includeExternalReferences")!=std::string::npos; - bool newExternals = optionsString.find("writeExternalReferenceFiles")!=std::string::npos; - if (newExternals) + if (fw.getOptions()) { - useOriginalExternalReferences = false; - writeExternalReferenceFiles = true; - } - + std::string optionsString = fw.getOptions()->getOptionString(); + includeExternalReferences = optionsString.find("includeExternalReferences")!=std::string::npos; + bool newExternals = optionsString.find("writeExternalReferenceFiles")!=std::string::npos; + if (newExternals) + { + useOriginalExternalReferences = false; + writeExternalReferenceFiles = true; + } + } const ProxyNode& proxyNode = static_cast(obj); if (proxyNode.getCenterMode()==osg::ProxyNode::USER_DEFINED_CENTER) fw.indent() << "Center "<< proxyNode.getCenter() << std::endl;