From: eap Date: Fri, 23 Jan 2009 14:07:15 +0000 (+0000) Subject: 0019941: EDF 766 SMESH : Max length hypothesis X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=9d4a479350035af5a671b58067c569a1071df5e3;p=modules%2Fsmesh.git 0019941: EDF 766 SMESH : Max length hypothesis protect GetShapeDiagonalSize() from null shape --- diff --git a/src/SMESH/SMESH_Mesh.cxx b/src/SMESH/SMESH_Mesh.cxx index 5f29eb32c..866fda739 100644 --- a/src/SMESH/SMESH_Mesh.cxx +++ b/src/SMESH/SMESH_Mesh.cxx @@ -214,9 +214,12 @@ const TopoDS_Solid& SMESH_Mesh::PseudoShape() double SMESH_Mesh::GetShapeDiagonalSize(const TopoDS_Shape & aShape) { - Bnd_Box Box; - BRepBndLib::Add(aShape, Box); - return sqrt( Box.SquareExtent() ); + if ( !aShape.IsNull() ) { + Bnd_Box Box; + BRepBndLib::Add(aShape, Box); + return sqrt( Box.SquareExtent() ); + } + return 0; } //=======================================================================