From: nds Date: Fri, 22 Nov 2013 04:59:18 +0000 (+0000) Subject: Fix for the #trefs 121: undo leads error X-Git-Tag: BR_hydro_v_0_3_1~12 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=8c684d855bd28db57889a5fc78c0bdd3e638f7a8;p=modules%2Fhydro.git Fix for the #trefs 121: undo leads error --- diff --git a/src/HYDROCurveCreator/CurveCreator_Curve.cxx b/src/HYDROCurveCreator/CurveCreator_Curve.cxx index a05c4836..a07b1316 100644 --- a/src/HYDROCurveCreator/CurveCreator_Curve.cxx +++ b/src/HYDROCurveCreator/CurveCreator_Curve.cxx @@ -654,7 +654,8 @@ int CurveCreator_Curve::getNbPoints( const int theISection ) const aNbCoords += mySections[i]->myPoints.size(); } } else { - aNbCoords = mySections.at(theISection)->myPoints.size(); + if ( ( theISection >= 0 ) && ( theISection < mySections.size() ) ) + aNbCoords = mySections.at(theISection)->myPoints.size(); } return aNbCoords/myDimension; @@ -1002,7 +1003,12 @@ CurveCreator::Coordinates CurveCreator_Curve::getPoint( const int theISection, //======================================================================= CurveCreator::Coordinates CurveCreator_Curve::getPoints( const int theISection ) const { - return mySections.at(theISection)->myPoints; + CurveCreator::Coordinates aCoords; + if ( ( theISection >= 0 ) && ( theISection < mySections.size() ) ) + { + aCoords = mySections.at(theISection)->myPoints; + } + return aCoords; }