Salome HOME
High level objects history implementation for LinearCopy and AngularCopy features.
[modules/shaper.git] / src / PartSet / PartSet_WidgetSketchLabel.cpp
index 8714eb98d5d4fe387583b7772b3079bc3acd9585..14c7fbe576df29fc159cde3c618d86a771cc4900 100644 (file)
@@ -465,10 +465,11 @@ bool PartSet_WidgetSketchLabel::fillSketchPlaneBySelection(const ModuleBase_View
       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;