if (!anAIS.IsNull()) {
Handle(AIS_Shape) aAISShape = Handle(AIS_Shape)::DownCast(anAIS);
if (!aAISShape.IsNull()) {
- return aAISShape->Shape().ShapeType();
+ const TopoDS_Shape aShape = aAISShape->Shape();
+ if (!aShape.IsNull())
+ return aShape.ShapeType();
}
}
return -1;
aValid = Standard_False;
if (theOwner->HasSelectable()) {
Handle(StdSelect_BRepOwner) aShapeOwner = Handle(StdSelect_BRepOwner)::DownCast(theOwner);
- if (!aShapeOwner.IsNull()) {
+ if (!aShapeOwner.IsNull() && aShapeOwner->HasShape()) {
TopoDS_Shape aShape = aShapeOwner->Shape();
TopAbs_ShapeEnum aType = aShape.ShapeType();
gp_Pln aPlane = myPlane->impl<gp_Pln>();
std::shared_ptr<GeomAPI_Shape> aShapePtr = ModelAPI_Tools::shape(aResult);
if (aShapePtr.get()) {
const TopoDS_Shape& aOldShape = aShapePrs->Shape();
- isEqualShapes = aOldShape.IsEqual(aShapePtr->impl<TopoDS_Shape>());
+ if (!aOldShape.IsNull())
+ isEqualShapes = aOldShape.IsEqual(aShapePtr->impl<TopoDS_Shape>());
}
}
}
// we should not check the appearance of this feature because there can be some selected shapes
// for one feature
Handle(StdSelect_BRepOwner) aBRO = Handle(StdSelect_BRepOwner)::DownCast(theOwner);
- if( !aBRO.IsNull() ) {
+ if( !aBRO.IsNull() && aBRO->HasShape() ) {
// the located method is called in the context to obtain the shape by the SelectedShape() method,
// so the shape is located by the same rules
TopoDS_Shape aShape = aBRO->Shape().Located (aBRO->Location() * aBRO->Shape().Location());