]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
Fix for the #trefs 121: undo leads error
authornds <nds@opencascade.com>
Fri, 22 Nov 2013 04:59:18 +0000 (04:59 +0000)
committernds <nds@opencascade.com>
Fri, 22 Nov 2013 04:59:18 +0000 (04:59 +0000)
src/HYDROCurveCreator/CurveCreator_Curve.cxx

index a05c4836ea75d0538d551cd467d7122be5be8f8e..a07b1316bc2513426da5b0d1869e00d70e07daf5 100644 (file)
@@ -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;
 }