From 84c2d914abe0a47ccc4a8dff4360fea90b20284e Mon Sep 17 00:00:00 2001 From: vsv Date: Tue, 6 Sep 2016 15:42:30 +0300 Subject: [PATCH] Fix of non-correct statement --- src/SketchPlugin/SketchPlugin_Validators.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) 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()); -- 2.39.2