]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
patch for crash
authorasl <asl@opencascade.com>
Fri, 10 Nov 2017 10:21:34 +0000 (13:21 +0300)
committerasl <asl@opencascade.com>
Fri, 10 Nov 2017 10:21:34 +0000 (13:21 +0300)
src/CurveCreator/CurveCreator_Section.cxx

index 2b9beda578e425f79c1af0f5c09ace3732531b2f..0052bcbec2b7e68862159bb7f07376522a891b7e 100644 (file)
@@ -35,12 +35,16 @@ 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);
+
+  if( myPoints.size() > 0 )
+  {
+    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);
+  }
 
   for (; aPIt != aPItLast; aPIt += theDimension)
   {