From: eap Date: Wed, 29 Mar 2006 11:28:20 +0000 (+0000) Subject: PAL12037. Add protection against None shapes and empty geom groups X-Git-Tag: T3_2_0b1_pre1~68 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=ef1f1f4c8ee136cc16e7a36da732ccc188ccacb6;p=modules%2Fsmesh.git PAL12037. Add protection against None shapes and empty geom groups --- diff --git a/src/SMESH_SWIG/smesh.py b/src/SMESH_SWIG/smesh.py index ec24cadfa..5e37242dc 100644 --- a/src/SMESH_SWIG/smesh.py +++ b/src/SMESH_SWIG/smesh.py @@ -128,6 +128,8 @@ class Mesh_Algorithm: """ Private method """ + if geom is None: + raise RuntimeError, "Attemp to create " + hypo + " algoritm on None shape" self.mesh = mesh piece = mesh.geom if geom==0: @@ -606,6 +608,9 @@ class Mesh: elif tgeo == "SHELL": type = SMESH.VOLUME elif tgeo == "COMPOUND": + if len( geompy.GetObjectIDs( grp )) == 0: + print "Mesh.Group: empty geometric group", GetName( grp ) + return 0 tgeo = geompy.GetType(grp) if tgeo == geompy.ShapeType["VERTEX"]: type = SMESH.NODE