From 316c1a88a95a654badeb5649b4285c76550f3712 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Tue, 2 Nov 2010 11:19:17 +0000 Subject: [PATCH] From Javier Taibo, " In current SVN code, when exporting an osgParticle::Particle object to the .osg file format, it crashes if no drawable was set in the particle. In the attached file (src/osgWrappers/deprecated-dotosg/osgParticle/IO_Particle.cpp) I have added a check for the existence of the drawable before writing it to the file. " --- .../deprecated-dotosg/osgParticle/IO_Particle.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/osgWrappers/deprecated-dotosg/osgParticle/IO_Particle.cpp b/src/osgWrappers/deprecated-dotosg/osgParticle/IO_Particle.cpp index 204725f4f..efb255e2c 100644 --- a/src/osgWrappers/deprecated-dotosg/osgParticle/IO_Particle.cpp +++ b/src/osgWrappers/deprecated-dotosg/osgParticle/IO_Particle.cpp @@ -249,12 +249,14 @@ void write_particle(const osgParticle::Particle &P, osgDB::Output &fw) fw.writeObject(*P.getColorInterpolator()); fw.moveOut(); fw.indent() << "}" << std::endl; - - fw.indent() << "drawable {" << std::endl; - fw.moveIn(); - fw.writeObject(*P.getDrawable()); - fw.moveOut(); - fw.indent() << "}" << std::endl; + + if ( P.getDrawable() != NULL ) { + fw.indent() << "drawable {" << std::endl; + fw.moveIn(); + fw.writeObject(*P.getDrawable()); + fw.moveOut(); + fw.indent() << "}" << std::endl; + } fw.moveOut(); fw.indent() << "}" << std::endl;