]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Fix for Bug IPAL15096
authorapo <apo@opencascade.com>
Thu, 17 May 2007 05:34:34 +0000 (05:34 +0000)
committerapo <apo@opencascade.com>
Thu, 17 May 2007 05:34:34 +0000 (05:34 +0000)
 - IOLS. Crash of application on selection GUI state:# by right mouse button.

In some cases selection can have non empty "entry" and "IO" but there will be no corresponding SObject!

src/VISUGUI/VisuGUI_Tools.cxx

index 6db653523cf65af09c9c5e2db977dd8317facc05..a4246b58354738bd45de2de013053b9c60e06b69 100644 (file)
@@ -289,10 +289,12 @@ namespace VISU
       if(anIO->hasEntry())
       {
         TObjectInfo anObjectInfo = GetObjectByEntry(aStudy, anIO->getEntry());
-        TSelectionItem aSelectionItem;
-        aSelectionItem.myObjectInfo = anObjectInfo;
-        aSelectionItem.myIO = anIO;
-        aSelectionInfo.push_back(aSelectionItem);
+       if(anObjectInfo.mySObject){
+         TSelectionItem aSelectionItem;
+         aSelectionItem.myObjectInfo = anObjectInfo;
+         aSelectionItem.myIO = anIO;
+         aSelectionInfo.push_back(aSelectionItem);
+       }
       }
       anIter.Next(); // MULTIPR fixed
     }
@@ -349,11 +351,13 @@ namespace VISU
   GetStorableMap(_PTR(SObject) theSObject)
   {
     Storable::TRestoringMap aMap;
-    _PTR(GenericAttribute) anAttr;
-    if(theSObject->FindAttribute(anAttr,"AttributeString")){
-      _PTR(AttributeString) aComment (anAttr);
-      std::string aValue = aComment->Value();
-      VISU::Storable::StrToMap(aValue.c_str(), aMap);
+    if(theSObject){
+      _PTR(GenericAttribute) anAttr;
+      if(theSObject->FindAttribute(anAttr,"AttributeString")){
+       _PTR(AttributeString) aComment (anAttr);
+       std::string aValue = aComment->Value();
+       VISU::Storable::StrToMap(aValue.c_str(), aMap);
+      }
     }
     return aMap;
   }