Salome HOME
Avoid too often Standard_OutOfRange
authoreap <eap@opencascade.com>
Mon, 28 Apr 2014 10:06:27 +0000 (14:06 +0400)
committereap <eap@opencascade.com>
Mon, 28 Apr 2014 10:06:27 +0000 (14:06 +0400)
src/SMESHDS/SMESHDS_Mesh.cxx

index 089e9fe..6766fbd 100644 (file)
@@ -1376,7 +1376,8 @@ const TopoDS_Shape& SMESHDS_Mesh::IndexToShape(int ShapeIndex) const
 {
   try
   {
-    return myIndexToShape.FindKey(ShapeIndex);
+    if ( ShapeIndex > 0 )
+      return myIndexToShape.FindKey(ShapeIndex);
   }
   catch ( Standard_OutOfRange )
   {