From: asl Date: Fri, 10 Nov 2017 10:21:34 +0000 (+0300) Subject: patch for crash X-Git-Tag: v2.1~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=6dc51244491d9a127b22f2af96786b12190304af;p=modules%2Fgeom.git patch for crash --- diff --git a/src/CurveCreator/CurveCreator_Section.cxx b/src/CurveCreator/CurveCreator_Section.cxx index 2b9beda57..0052bcbec 100644 --- a/src/CurveCreator/CurveCreator_Section.cxx +++ b/src/CurveCreator/CurveCreator_Section.cxx @@ -35,12 +35,16 @@ Handle(TColgp_HArray1OfPnt) CurveCreator_Section::GetDifferentPoints( int theDim Handle(TColgp_HArray1OfPnt) points; std::vector 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) {