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 =