From: eap Date: Thu, 8 Nov 2012 15:34:29 +0000 (+0000) Subject: 0021954: [CEA 706] Error at the mesh object creation X-Git-Tag: V6_6_0b1~5 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=ea5674061b13cfac0cb5f094c8ac9f5b925a2ade;p=modules%2Fsmesh.git 0021954: [CEA 706] Error at the mesh object creation protect fillAncestorsMap() from empty compounds --- diff --git a/src/SMESH/SMESH_Mesh.cxx b/src/SMESH/SMESH_Mesh.cxx index 0b171a6ef..57c618de1 100644 --- a/src/SMESH/SMESH_Mesh.cxx +++ b/src/SMESH/SMESH_Mesh.cxx @@ -1999,7 +1999,9 @@ void SMESH_Mesh::fillAncestorsMap(const TopoDS_Shape& theShape) { // a geom group is added. Insert it into lists of ancestors before // the first ancestor more complex than group members - int memberType = TopoDS_Iterator( theShape ).Value().ShapeType(); + TopoDS_Iterator subIt( theShape ); + if ( !subIt.More() ) return; + int memberType = subIt.Value().ShapeType(); for ( desType = TopAbs_VERTEX; desType >= memberType; desType-- ) for (TopExp_Explorer des( theShape, TopAbs_ShapeEnum( desType )); des.More(); des.Next()) {