std::shared_ptr<GeomAPI_Shape> aGeomShape = aConstr->shape();
if (aGeomShape.get()) {
const TopoDS_Shape& aShape = aGeomShape->impl<TopoDS_Shape>();
- if (aShape.ShapeType() != TopAbs_EDGE)
+ if (!aShape.IsNull() && aShape.ShapeType() != TopAbs_EDGE)
anAuxiliaryResults.push_back(aConstr);
}
}
static const double tolerance = 1.e-7;
+static std::shared_ptr<GeomAPI_Edge> emptyEdge()
+{
+ static std::shared_ptr<GeomAPI_Edge> anEdge(new GeomAPI_Edge);
+ return anEdge;
+}
+
SketchPlugin_Projection::SketchPlugin_Projection()
: SketchPlugin_SketchEntity(),
myIsComputing(false)
if (!lastResult().get() && aProjection->lastResult().get()) {
ResultConstructionPtr aConstr = document()->createConstruction(data());
- aConstr->setShape(aProjection->lastResult()->shape());
+ aConstr->setShape(emptyEdge());
aConstr->setIsInHistory(false);
aConstr->setDisplayed(false);
setResult(aConstr);
selection(EXTERNAL_ID())->setValue(aExtFeature->context(), aExtFeature->context()->shape());
if (aResult) {
- aResult->setShape(aProjection->lastResult()->shape());
+ aResult->setShape(emptyEdge());
setResult(aResult);
aProjection->selection(EXTERNAL_ID())->setValue(lastResult(), lastResult()->shape());
}