From 9818c0fee2d87e27d85d6db81348f6f211dab5e6 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Mon, 20 Dec 2010 12:02:50 +0000 Subject: [PATCH] From Kim Seokhwan, "Error fix in example/osganimationmorph/osganimationmorph.cpp in this file, function, osg::Geometry* getShape(const std::string& name) (line 51) tries to use null pointer when model is not provided. I added simple comment in attached file." --- examples/osganimationmorph/osganimationmorph.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/examples/osganimationmorph/osganimationmorph.cpp b/examples/osganimationmorph/osganimationmorph.cpp index be8649f04..8d8fbdb3c 100644 --- a/examples/osganimationmorph/osganimationmorph.cpp +++ b/examples/osganimationmorph/osganimationmorph.cpp @@ -52,8 +52,20 @@ osg::Geometry* getShape(const std::string& name) { osg::Node* shape0 = osgDB::readNodeFile(name); GeometryFinder finder; + /* shape0->accept(finder); return finder._geom.get(); + */ + //is changed to + if (shape0) + { + shape0->accept(finder); + return finder._geom.get(); + } + else + { + return NULL; + } }