From c56dd6faa5c558398edf94d69292c7687382a8ab Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Sat, 22 Aug 2009 17:13:19 +0000 Subject: [PATCH] From Michael Platings, "the DAE importer was crashing when calling osg::Object::setName with a null pointer argument. Rather than trying to fix all the places this might happen and probably missing a few, I thought it would be better to trivially validate the input in setName. With this fix if setName is called with a null pointer then the name is cleared." --- include/osg/Object | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/include/osg/Object b/include/osg/Object index 73df9effe..01dd65619 100644 --- a/include/osg/Object +++ b/include/osg/Object @@ -99,7 +99,11 @@ class OSG_EXPORT Object : public Referenced inline void setName( const std::string& name ) { _name = name; } /** Set the name of object using a C style string.*/ - inline void setName( const char* name ) { _name = name; } + inline void setName( const char* name ) + { + if (name) _name = name; + else _name.clear(); + } /** Get the name of object.*/ inline const std::string& getName() const { return _name; }