From d85d44875c2d9c97c1ec56c5da04f8033058410f Mon Sep 17 00:00:00 2001 From: eap Date: Wed, 29 Mar 2006 11:27:26 +0000 Subject: [PATCH] PAL12037. Add protection against None shapes and empty geom groups --- src/SMESH_SWIG/smesh.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/SMESH_SWIG/smesh.py b/src/SMESH_SWIG/smesh.py index 5034d8e05..eafc2c080 100644 --- a/src/SMESH_SWIG/smesh.py +++ b/src/SMESH_SWIG/smesh.py @@ -89,6 +89,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: @@ -437,6 +439,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 -- 2.39.2