Salome HOME
Debug of the parametric model updates
[modules/shaper.git] / src / SketchPlugin / SketchPlugin_Line.cpp
index 75c404a772a12922e9bd6284a8b07e4d3a952d15..95b6de896acd8644ace08a86a29f8a48e17f047b 100644 (file)
@@ -21,8 +21,7 @@ using namespace std;
 
 SketchPlugin_Line::SketchPlugin_Line()
     : SketchPlugin_Feature()
-{
-}
+{}
 
 void SketchPlugin_Line::initAttributes()
 {
@@ -101,7 +100,8 @@ bool SketchPlugin_Line::isFixed() {
 void SketchPlugin_Line::attributeChanged() {
   static bool myIsUpdated = false; // to avoid infinitive cycle on attrubtes change
   boost::shared_ptr<GeomAPI_Shape> aSelection = data()->selection(EXTERNAL_ID())->value();
-  if (aSelection && !myIsUpdated) { // update arguments due to the selection value
+   // update arguments due to the selection value
+  if (aSelection && !aSelection->isNull() && !myIsUpdated) {
     myIsUpdated = true;
     boost::shared_ptr<GeomAPI_Edge> anEdge( new GeomAPI_Edge(aSelection));
     boost::shared_ptr<GeomDataAPI_Point2D> aStartAttr =