From ea5674061b13cfac0cb5f094c8ac9f5b925a2ade Mon Sep 17 00:00:00 2001 From: eap Date: Thu, 8 Nov 2012 15:34:29 +0000 Subject: [PATCH] 0021954: [CEA 706] Error at the mesh object creation protect fillAncestorsMap() from empty compounds --- src/SMESH/SMESH_Mesh.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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()) { -- 2.39.2