From: vsv Date: Tue, 6 Sep 2016 12:42:30 +0000 (+0300) Subject: Fix of non-correct statement X-Git-Tag: V_2.5.0~43 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=84c2d914abe0a47ccc4a8dff4360fea90b20284e;p=modules%2Fshaper.git Fix of non-correct statement --- diff --git a/src/SketchPlugin/SketchPlugin_Validators.cpp b/src/SketchPlugin/SketchPlugin_Validators.cpp index 5cb16e6b0..9db33a5ed 100755 --- a/src/SketchPlugin/SketchPlugin_Validators.cpp +++ b/src/SketchPlugin/SketchPlugin_Validators.cpp @@ -891,13 +891,16 @@ bool SketchPlugin_ProjectionValidator::isValid(const AttributePtr& theAttribute, AttributeSelectionPtr aFeatureAttr = std::dynamic_pointer_cast(theAttribute); std::shared_ptr anEdge; - if(aFeatureAttr && aFeatureAttr->value() && aFeatureAttr->value()->isEdge()) { - anEdge = std::shared_ptr(new GeomAPI_Edge(aFeatureAttr->value())); - } else if(aFeatureAttr->context() && aFeatureAttr->context()->shape() && - aFeatureAttr->context()->shape()->isEdge()) { - anEdge = std::shared_ptr(new GeomAPI_Edge(aFeatureAttr->context()->shape())); + if (aFeatureAttr.get()) { + GeomShapePtr aVal = aFeatureAttr->value(); + ResultPtr aRes = aFeatureAttr->context(); + if(aFeatureAttr->value() && aFeatureAttr->value()->isEdge()) { + anEdge = std::shared_ptr(new GeomAPI_Edge(aFeatureAttr->value())); + } else if(aFeatureAttr->context() && aFeatureAttr->context()->shape() && + aFeatureAttr->context()->shape()->isEdge()) { + anEdge = std::shared_ptr(new GeomAPI_Edge(aFeatureAttr->context()->shape())); + } } - if (!anEdge) { theError = "The attribute %1 should be an edge"; theError.arg(theAttribute->id());