# HG changeset patch # User lbessard # Date 1189433549 -7200 # Node ID a6ff2b3fcc25b805229e83033381c5734da9a48e # Parent bac6435df86f84bbd9a121ed775ec444b98bc6a2 Bug on block deletion fixed diff -r bac6435df86f -r a6ff2b3fcc25 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)