Salome HOME
updated copyright message
[modules/shaper.git] / src / SketchPlugin / SketchPlugin_Sketch.h
index 6feda008dd89d3a607d48306566c0f362184592f..571dd18fbce47feec25603c1b735d33fbc0830a0 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2023  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
@@ -160,10 +160,10 @@ class SketchPlugin_Sketch : public ModelAPI_CompositeFeature//, public GeomAPI_I
     std::shared_ptr<GeomDataAPI_Dir> aNorm = std::dynamic_pointer_cast<GeomDataAPI_Dir>(
         data()->attribute(NORM_ID()));
 
-    if (!anOrigin || !aNorm)
-      return std::shared_ptr<GeomAPI_Pln>();
+    if (anOrigin.get() && aNorm.get() && anOrigin->isInitialized() && aNorm->isInitialized())
+      return std::shared_ptr<GeomAPI_Pln>(new GeomAPI_Pln(anOrigin->pnt(), aNorm->dir()));
 
-    return std::shared_ptr<GeomAPI_Pln>(new GeomAPI_Pln(anOrigin->pnt(), aNorm->dir()));
+    return std::shared_ptr<GeomAPI_Pln>();
   }
 
   /// Returns currently defined plane as an object of Ax3