editors/Viewer.py
changeset 1292 bac1b86276d9
parent 1287 70dc98533ec6
child 1293 40117d02601b
--- 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()