Salome HOME
Adjust test cases reference data according to precise calculation of bounding boxes.
[modules/shaper.git] / src / FeaturesPlugin / FeaturesPlugin_Translation.cpp
index 3eeaac0fa512846cca9b25338e2359b6dd59c8d4..37695957df3b59afc4133ca34f8c025ccc7895cd 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2020  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
@@ -178,15 +178,19 @@ GeomTrsfPtr FeaturesPlugin_Translation::translationByTwoPoints()
   }
 
   GeomTrsfPtr aTrsf(new GeomAPI_Trsf);
-  aTrsf->setTranslation(aFirstPoint, aSecondPoint);
+  if (aFirstPoint && aSecondPoint) {
+    aTrsf->setTranslation(aFirstPoint, aSecondPoint);
+  }
   return aTrsf;
 }
 
 //=================================================================================================
 void FeaturesPlugin_Translation::performTranslation(const GeomTrsfPtr& theTrsf)
 {
-  if (!theTrsf)
+  if (!theTrsf) {
+    setError("Invalid transformation.");
     return;
+  }
 
   bool isKeepSubShapes = data()->version() == TRANSLATION_VERSION_1;