Merged
authorLaurent Bessard
Wed, 28 Aug 2013 11:53:50 +0200
changeset 1292 bac1b86276d9
parent 1291 42ea51d083ce (current diff)
parent 1287 70dc98533ec6 (diff)
child 1293 40117d02601b
Merged
--- a/editors/Viewer.py	Wed Aug 28 11:52:46 2013 +0200
+++ b/editors/Viewer.py	Wed Aug 28 11:53:50 2013 +0200
@@ -2423,11 +2423,12 @@
                     executionOrder = values["executionOrder"])
             self.Controler.AddEditedElementBlock(self.TagName, id, values["type"], values.get("name", None))
             connector = None
-            for input_connector in block.GetConnectors()["inputs"]:
-                if input_connector.IsCompatible(
-                        wire.GetStartConnectedType()):
-                    connector = input_connector
-                    break
+            if wire is not None:
+                for input_connector in block.GetConnectors()["inputs"]:
+                    if input_connector.IsCompatible(
+                            wire.GetStartConnectedType()):
+                        connector = input_connector
+                        break
             self.AddNewElement(block, bbox, wire, connector)
         dialog.Destroy()