Salome HOME
Fix for the issue Crash on export file if name of resulting file contain the name...
[modules/shaper.git] / src / SketchSolver / SketchSolver_ConstraintMovement.cpp
index f5d6df055692edda89410318425c4c0cc87cb211..fdc4b0e78ff85afa6e34be69fb70fc3341219d67 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2017  CEA/DEN, EDF R&D
+// Copyright (C) 2017-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // You should have received a copy of the GNU Lesser General Public
 // License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <SketchSolver_ConstraintMovement.h>
@@ -212,6 +211,9 @@ void SketchSolver_ConstraintMovement::startPoint(
 void SketchSolver_ConstraintMovement::moveTo(
     const std::shared_ptr<GeomAPI_Pnt2d>& theDestinationPoint)
 {
+  if (!myMovedFeature)
+    return; // nothing to move
+
   double aDelta[2] = { theDestinationPoint->x() - myStartPoint->x(),
                        theDestinationPoint->y() - myStartPoint->y() };