From ee3e79b375d3c4d2e8381d46b612e969adc87816 Mon Sep 17 00:00:00 2001 From: apo Date: Thu, 17 May 2007 05:34:34 +0000 Subject: [PATCH] Fix for Bug IPAL15096 - 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 | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/VISUGUI/VisuGUI_Tools.cxx b/src/VISUGUI/VisuGUI_Tools.cxx index 6db65352..a4246b58 100644 --- a/src/VISUGUI/VisuGUI_Tools.cxx +++ b/src/VISUGUI/VisuGUI_Tools.cxx @@ -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; } -- 2.39.2