Check the node Add operator's type property before attempting to create a new node...
authorLukas Toenne <lukas.toenne@googlemail.com>
Sun, 6 Oct 2013 10:49:40 +0000 (10:49 +0000)
committerLukas Toenne <lukas.toenne@googlemail.com>
Sun, 6 Oct 2013 10:49:40 +0000 (10:49 +0000)
Reported by Sebastian Koenig in unrelated bug report #36968.

release/scripts/startup/bl_operators/node.py

index 9b629c3f976faa2c07e66b54065acaac7b2c0f3c..77978c71ed90a42e284585eb6836aa815b054ca3 100644 (file)
@@ -113,8 +113,11 @@ class NodeAddOperator():
 
     # Default execute simply adds a node
     def execute(self, context):
-        self.create_node(context)
-        return {'FINISHED'}
+        if self.properties.is_property_set("type"):
+            self.create_node(context)
+            return {'FINISHED'}
+        else:
+            return {'CANCELLED'}
 
     # Default invoke stores the mouse position to place the node correctly
     # and optionally invokes the transform operator