]> OCCT Git - occt-copy.git/commitdiff
0030784: Visualization - check if selectable of owner in internal container in AIS_In...
authorvro <vro@opencascade.com>
Tue, 3 Sep 2019 06:41:28 +0000 (09:41 +0300)
committernds <nds@opencascade.com>
Fri, 4 Oct 2019 15:56:16 +0000 (18:56 +0300)
# Issue #1140: Click on interactive cube crashes the application.

(cherry picked from commit fd8fbd466b19256a4bef6310dd0dc9f87ba1383f)

src/AIS/AIS_InteractiveContext_1.cxx

index 49959fc443872153a170494401ba7c233f55566c..d9782236daaea62cc1ad3ef2ca0395ca6b86288c 100644 (file)
@@ -575,7 +575,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);
 }