From 6dc51244491d9a127b22f2af96786b12190304af Mon Sep 17 00:00:00 2001 From: asl Date: Fri, 10 Nov 2017 13:21:34 +0300 Subject: [PATCH] patch for crash --- src/CurveCreator/CurveCreator_Section.cxx | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) 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) {