]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
PAL12037. Add protection against None shapes and empty geom groups T2_2_9pre
authoreap <eap@opencascade.com>
Wed, 29 Mar 2006 11:27:26 +0000 (11:27 +0000)
committereap <eap@opencascade.com>
Wed, 29 Mar 2006 11:27:26 +0000 (11:27 +0000)
src/SMESH_SWIG/smesh.py

index 5034d8e052d064f67fb05a7a2bf55b959f7ffdfa..eafc2c0802739ad443938f6c4473c2246dd7564c 100644 (file)
@@ -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