Bug on block deletion fixed
authorlbessard
Mon, 10 Sep 2007 16:12:29 +0200
changeset 89 a6ff2b3fcc25
parent 88 bac6435df86f
child 90 2245e8776086
Bug on block deletion fixed
plcopen/plcopen.py
--- a/plcopen/plcopen.py	Mon Sep 10 09:00:50 2007 +0200
+++ b/plcopen/plcopen.py	Mon Sep 10 16:12:29 2007 +0200
@@ -442,14 +442,16 @@
             for instance in self.getInstances():
                 if isinstance(instance, PLCOpenClasses["block"]) and instance.getInstanceName() == name:
                     return True
-            for transition in self.transitions.getTransition():
-                result = transition.hasBlock(name)
-                if result:
-                    return result
-            for action in self.actions.getAction():
-                result = action.hasBlock(name)
-                if result:
-                    return result
+            if self.transitions:
+                for transition in self.transitions.getTransition():
+                    result = transition.hasBlock(name)
+                    if result:
+                        return result
+            if self.actions:
+                for action in self.actions.getAction():
+                    result = action.hasBlock(name)
+                    if result:
+                        return result
         return False
     setattr(cls, "hasBlock", hasBlock)