]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
prevent SIGFPE in SetParametersByMesh() when there are no edges in submesh
authoreap <eap@opencascade.com>
Thu, 13 Apr 2006 09:58:01 +0000 (09:58 +0000)
committereap <eap@opencascade.com>
Thu, 13 Apr 2006 09:58:01 +0000 (09:58 +0000)
src/StdMeshers/StdMeshers_AutomaticLength.cxx

index fa74a7dc5d5a86ac3544761e0b76af666b2a14fc..551843523cdba6fb3ac68d91585e321b5be56b7c 100644 (file)
@@ -300,7 +300,10 @@ bool StdMeshers_AutomaticLength::SetParametersByMesh(const SMESH_Mesh*   theMesh
     SMESHDS_SubMesh * eSubMesh = aMeshDS->MeshElements( edge );
     if ( !eSubMesh )
       return false;
-    double segLen = L / eSubMesh->NbElements();
+    int nbSeg = eSubMesh->NbElements();
+    if ( nbSeg < 1 )
+      continue;
+    double segLen = L / nbSeg;
 
     // get segment length from _TShapeToLength
     map<const TopoDS_TShape*, double>::iterator tshape_length =