else {
aSelAttr->setValue(aFeature, GeomShapePtr());
GeomShapePtr aShape = aSelAttr->value();
- if (!aShape.get() && aSelAttr->contextFeature()->firstResult().get()) {
+ if (!aShape.get() && aSelAttr->contextFeature().get() &&
+ aSelAttr->contextFeature()->firstResult().get()) {
aShape = aSelAttr->contextFeature()->firstResult()->shape();
}
- if (aShape.get()) {
+ if (aShape.get() && aShape->isPlanar()) {
const TopoDS_Shape& aTDShape = aShape->impl<TopoDS_Shape>();
setSketchPlane(aTDShape);
isOwnerSet = true;