Salome HOME
PAL21685: Fatal error after save/open study with Edit group as standalone group
authoreap <eap@opencascade.com>
Tue, 27 Apr 2010 06:37:28 +0000 (06:37 +0000)
committereap <eap@opencascade.com>
Tue, 27 Apr 2010 06:37:28 +0000 (06:37 +0000)
   * protect SObjectToObject() from exception in case of invalid IOR

src/SMESHGUI/SMESHGUI_Utils.cxx

index 8ccf90b2413966ccd1cc804c59bd9df6e7d960f3..6f921cd220b89ec61998a93c0776ca269c1b05a9 100644 (file)
@@ -190,7 +190,10 @@ namespace SMESH
       if (theSObject->FindAttribute(anAttr, "AttributeIOR")) {
         _PTR(AttributeIOR) anIOR = anAttr;
         CORBA::String_var aVal = anIOR->Value().c_str();
-        return app->orb()->string_to_object(aVal);
+        // string_to_object() DOC: If the input string is not valid ...
+        // a CORBA::SystemException is thrown.
+        if ( aVal && strlen( aVal ) > 0 )
+          return app->orb()->string_to_object(aVal);
       }
     }
     return CORBA::Object::_nil();