]> 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>
Tue, 3 Sep 2019 14:25:21 +0000 (17:25 +0300)
# Issue #1140: Click on interactive cube crashes the application.

src/AIS/AIS_InteractiveContext_1.cxx

index 9fa3206c6ac2702db957849707ffd7b06ae59c22..0d7cbde17793b4f82c9bb8aa51a9f9aa68324592 100644 (file)
@@ -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);
 }