From fd8fbd466b19256a4bef6310dd0dc9f87ba1383f Mon Sep 17 00:00:00 2001 From: vro Date: Tue, 3 Sep 2019 09:41:28 +0300 Subject: [PATCH] 0030784: Visualization - check if selectable of owner in internal container in AIS_InteractiveContext before using # Issue #1140: Click on interactive cube crashes the application. --- src/AIS/AIS_InteractiveContext_1.cxx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/AIS/AIS_InteractiveContext_1.cxx b/src/AIS/AIS_InteractiveContext_1.cxx index 9fa3206c6a..0d7cbde177 100644 --- a/src/AIS/AIS_InteractiveContext_1.cxx +++ b/src/AIS/AIS_InteractiveContext_1.cxx @@ -538,7 +538,16 @@ AIS_StatusOfPick AIS_InteractiveContext::Select (const AIS_SelectionScheme theSe }*/ AIS_NListOfEntityOwner aPickedOwners; - aPickedOwners.Append (myLastPicked); + if (!myLastPicked.IsNull() && + myLastPicked->HasSelectable()) + { + Handle(AIS_InteractiveObject) anIO = Handle(AIS_InteractiveObject)::DownCast(myLastPicked->Selectable()); + if (!anIO.IsNull() && + myObjects.IsBound(anIO)) + { + aPickedOwners.Append (myLastPicked); + } + } return Select (aPickedOwners, theSelScheme); } -- 2.39.5