From 2994a72b1afb59e03184edeff510fcdaa85f2bfd Mon Sep 17 00:00:00 2001 From: asv Date: Tue, 7 Mar 2006 09:34:57 +0000 Subject: [PATCH] added checking for isNull() in contextMenuPopup() --- src/VISUGUI/VisuGUI.cxx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/VISUGUI/VisuGUI.cxx b/src/VISUGUI/VisuGUI.cxx index 11b4a3fd..d5a19369 100644 --- a/src/VISUGUI/VisuGUI.cxx +++ b/src/VISUGUI/VisuGUI.cxx @@ -1411,7 +1411,8 @@ OnRestoreViewParams() //jfa tmp:VISU::View3D_i::RestoreViewParams(aViewMgr, anIO->getName()); _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));//jfa tmp _PTR(SObject) aSObj = aCStudy->FindObjectID(anIO->getEntry());//jfa tmp - VISU::View3D_i::RestoreViewParams(aViewMgr, aSObj->GetName().c_str());//jfa tmp + if ( aSObj ) + VISU::View3D_i::RestoreViewParams(aViewMgr, aSObj->GetName().c_str());//jfa tmp } void @@ -2573,6 +2574,8 @@ void VisuGUI::contextMenuPopup( const QString& theClient, QPopupMenu* theMenu, Q if (!anIO.IsNull() && anIO->hasEntry()) { _PTR(SObject) aSObject = aCStudy->FindObjectID(anIO->getEntry()); + if ( !aSObject ) + continue; CORBA::Object_var aCORBAObject = VISU::ClientSObjectToObject(aSObject); if (CORBA::is_nil(aCORBAObject)) { _PTR(GenericAttribute) anAttr; @@ -2620,6 +2623,8 @@ void VisuGUI::contextMenuPopup( const QString& theClient, QPopupMenu* theMenu, Q if (!anIO.IsNull() && anIO->hasEntry()) { _PTR(SObject) aSObject = aCStudy->FindObjectID(anIO->getEntry()); + if ( !aSObject ) + continue; _PTR(GenericAttribute) anAttr; if (aSObject->FindAttribute(anAttr, "AttributeComment")) { _PTR(AttributeComment) aComment (anAttr); @@ -2650,6 +2655,8 @@ void VisuGUI::contextMenuPopup( const QString& theClient, QPopupMenu* theMenu, Q CORBA::Object_var anObject = GetSelectedObj( this, &anIO, &aMap); _PTR(SObject) SO = aCStudy->FindObjectID(anIO->getEntry()); + if ( !SO ) + return; bool isExist; VISU::VISUType aType = (VISU::VISUType)VISU::Storable::FindValue(aMap,"myType",&isExist).toInt(); -- 2.39.2