Salome HOME
#19078 [CEA] Mesh Group - Group on filter
[modules/smesh.git] / src / SMESH_I / SMESH_Gen_i_1.cxx
index 94df9beb3b21a299ca327ba8126adac5dadf510d..4c78e23167b83c632d3dcaf13a2b4473ef68c776 100644 (file)
@@ -196,10 +196,15 @@ bool SMESH_Gen_i::CanPublishInStudy(CORBA::Object_ptr theIOR)
 SALOMEDS::SObject_ptr SMESH_Gen_i::ObjectToSObject(CORBA::Object_ptr theObject)
 {
   SALOMEDS::SObject_wrap aSO;
-  if ( !CORBA::is_nil( theObject ))
+  try {
+    if ( !CORBA::is_nil( theObject ))
+    {
+      CORBA::String_var objStr = SMESH_Gen_i::GetORB()->object_to_string( theObject );
+      aSO = getStudyServant()->FindObjectIOR( objStr.in() );
+    }
+  }
+  catch (...)
   {
-    CORBA::String_var objStr = SMESH_Gen_i::GetORB()->object_to_string( theObject );
-    aSO = getStudyServant()->FindObjectIOR( objStr.in() );
   }
   return aSO._retn();
 }