From: eap Date: Thu, 13 Apr 2006 09:58:01 +0000 (+0000) Subject: prevent SIGFPE in SetParametersByMesh() when there are no edges in submesh X-Git-Tag: T3_2_0b1_pre1~18 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=e97db243cc374bf9acafe742ce2043a35c8bfa1b;p=modules%2Fsmesh.git prevent SIGFPE in SetParametersByMesh() when there are no edges in submesh --- diff --git a/src/StdMeshers/StdMeshers_AutomaticLength.cxx b/src/StdMeshers/StdMeshers_AutomaticLength.cxx index fa74a7dc5..551843523 100644 --- a/src/StdMeshers/StdMeshers_AutomaticLength.cxx +++ b/src/StdMeshers/StdMeshers_AutomaticLength.cxx @@ -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::iterator tshape_length =