]> git.mxchange.org Git - simgear.git/commitdiff
Do not crash on exporting some EffectGeodes.
authorMathias Froehlich <Mathias.Froehlich@web.de>
Wed, 8 Jun 2011 11:42:30 +0000 (13:42 +0200)
committerMathias Froehlich <Mathias.Froehlich@web.de>
Wed, 8 Jun 2011 11:42:30 +0000 (13:42 +0200)
simgear/scene/material/EffectGeode.cxx

index eac2f15646a5c7f4affcc3b3a8ef9dc7334c7af8..26eab3852fdf6715864c23581c5a3af359dcee9a 100644 (file)
@@ -96,8 +96,11 @@ bool EffectGeode_writeLocalData(const Object& obj, osgDB::Output& fw)
 {
     const EffectGeode& eg = static_cast<const EffectGeode&>(obj);
 
-    fw.indent() << "effect\n";
-    fw.writeObject(*eg.getEffect());
+    if (eg.getEffect()) {
+        fw.indent() << "effect\n";
+        fw.writeObject(*eg.getEffect());
+    }
+
     return true;
 }