Salome HOME
0019941: EDF 766 SMESH : Max length hypothesis
authoreap <eap@opencascade.com>
Fri, 23 Jan 2009 14:07:15 +0000 (14:07 +0000)
committereap <eap@opencascade.com>
Fri, 23 Jan 2009 14:07:15 +0000 (14:07 +0000)
 protect GetShapeDiagonalSize() from null shape

src/SMESH/SMESH_Mesh.cxx

index 5f29eb32cd4c72c61f524fc64fd491eb9d53f7d7..866fda73926e79edab0079252b506292f3b302d2 100644 (file)
@@ -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;
 }
 
 //=======================================================================