0027724: Visualization, TKV3d - Null handle check missing in AIS_InteractiveContext...
authormgn <mgn@opencascade.com>
Tue, 2 Aug 2016 07:13:49 +0000 (10:13 +0300)
committerbugmaster <bugmaster@opencascade.com>
Thu, 4 Aug 2016 09:05:07 +0000 (12:05 +0300)
Null handle check has been added.

src/AIS/AIS_InteractiveContext_1.cxx

index 54fd1e1..9b07d86 100644 (file)
@@ -1239,7 +1239,7 @@ TopoDS_Shape AIS_InteractiveContext::SelectedShape() const
 
   const Handle(StdSelect_BRepOwner) anOwner =
     Handle(StdSelect_BRepOwner)::DownCast (mySelection->Value());
-  if (!anOwner->HasSelectable())
+  if (anOwner.IsNull() || !anOwner->HasSelectable())
     return TopoDS_Shape();
 
   return anOwner->Shape().Located (anOwner->Location() * anOwner->Shape().Location());