0027724: Visualization, TKV3d - Null handle check missing in AIS_InteractiveContext...
[occt.git] / 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());