Fixed bug when adding a block in Viewer
authorLaurent Bessard
Wed, 28 Aug 2013 11:43:51 +0200
changeset 1287 70dc98533ec6
parent 1286 adda406d3960
child 1288 adc79fc44079
child 1289 1d221eda1e42
child 1292 bac1b86276d9
Fixed bug when adding a block in Viewer
editors/Viewer.py
--- a/editors/Viewer.py	Wed Aug 07 11:47:14 2013 +0200
+++ b/editors/Viewer.py	Wed Aug 28 11:43:51 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()