]> OCCT Git - occt-copy.git/commitdiff
refs #1140: Click on interactive cube crashes the application
authorvro <vro@opencascade.com>
Wed, 14 Aug 2019 12:41:20 +0000 (15:41 +0300)
committervro <vro@opencascade.com>
Wed, 14 Aug 2019 12:41:20 +0000 (15:41 +0300)
src/AIS/AIS_InteractiveContext_1.cxx

index 89ecf91a0b2d288d6d1eb9dbcf18a0092fe64aa4..c49b2108a9d89ec6b080f67198bbc293899b3e13 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() &&
+        IsDisplayed(anIO))
+    {
+      aPickedOwners.Append (myLastinMain);
+    }
+  }
 
   return Select (aPickedOwners, theSelScheme);
 }