]> OCCT Git - occt-copy.git/commitdiff
Issue #1140: Click on interactive cube crashes the application. CR0_DMUReviewer_2
authorvro <vro@opencascade.com>
Tue, 3 Sep 2019 06:41:28 +0000 (09:41 +0300)
committervro <vro@opencascade.com>
Tue, 3 Sep 2019 06:41:28 +0000 (09:41 +0300)
src/AIS/AIS_InteractiveContext_1.cxx

index 89ecf91a0b2d288d6d1eb9dbcf18a0092fe64aa4..c52cae9de837a23daa4bbfba19d22e1791402c98 100644 (file)
@@ -470,7 +470,16 @@ AIS_StatusOfPick AIS_InteractiveContext::Select (const AIS_SelectionScheme theSe
   }*/
 
   AIS_NListOfEntityOwner aPickedOwners;
-  aPickedOwners.Append (myLastinMain);
+  if (!myLastinMain.IsNull() &&
+      myLastinMain->HasSelectable())
+  {
+    Handle(AIS_InteractiveObject) anIO = Handle(AIS_InteractiveObject)::DownCast(myLastinMain->Selectable());
+    if (!anIO.IsNull() &&
+        myObjects.IsBound(anIO))
+    {
+      aPickedOwners.Append (myLastinMain);
+    }
+  }
 
   return Select (aPickedOwners, theSelScheme);
 }