Salome HOME
updated copyright message
[modules/geom.git] / src / CurveCreator / CurveCreator_Section.cxx
index 2b9beda578e425f79c1af0f5c09ace3732531b2f..cb14becbf0bf630dd1e0718e7afae80a5f58b70a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2023  CEA, EDF, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -35,12 +35,19 @@ Handle(TColgp_HArray1OfPnt) CurveCreator_Section::GetDifferentPoints( int theDim
   Handle(TColgp_HArray1OfPnt) points;
 
   std::vector<gp_Pnt> aTmpPoints;
+
   CurveCreator::Coordinates::const_iterator aPIt = myPoints.begin();
   CurveCreator::Coordinates::const_iterator aPItLast = myPoints.end();
-  const gp_Pnt aFirstPoint(
-    *aPIt, *(aPIt + 1), (theDimension == 2) ? 0 : *(aPIt + 2));
-  gp_Pnt aPoint = aFirstPoint;
-  aTmpPoints.push_back(aPoint);
+
+  gp_Pnt aFirstPoint;
+  gp_Pnt aPoint;
+
+  if( myPoints.size() > 0 )
+  {
+    aFirstPoint = gp_Pnt(*aPIt, *(aPIt + 1), (theDimension == 2) ? 0 : *(aPIt + 2));
+    aPoint = aFirstPoint;
+    aTmpPoints.push_back(aPoint);
+  }
 
   for (; aPIt != aPItLast; aPIt += theDimension)
   {