From: Mathias Froehlich Date: Wed, 8 Jun 2011 11:42:30 +0000 (+0200) Subject: Do not crash on exporting some EffectGeodes. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=9f0313dd0ba0def05a7ec6934faba9ad82e484f6;p=simgear.git Do not crash on exporting some EffectGeodes. --- diff --git a/simgear/scene/material/EffectGeode.cxx b/simgear/scene/material/EffectGeode.cxx index eac2f156..26eab385 100644 --- a/simgear/scene/material/EffectGeode.cxx +++ b/simgear/scene/material/EffectGeode.cxx @@ -96,8 +96,11 @@ bool EffectGeode_writeLocalData(const Object& obj, osgDB::Output& fw) { const EffectGeode& eg = static_cast(obj); - fw.indent() << "effect\n"; - fw.writeObject(*eg.getEffect()); + if (eg.getEffect()) { + fw.indent() << "effect\n"; + fw.writeObject(*eg.getEffect()); + } + return true; }