diff options
author | Lukas Toenne <lukas.toenne@googlemail.com> | 2013-10-06 14:49:40 +0400 |
---|---|---|
committer | Lukas Toenne <lukas.toenne@googlemail.com> | 2013-10-06 14:49:40 +0400 |
commit | 96f4ee03d4ac0dd5f9a8144b148cdb54291286b9 (patch) | |
tree | 6301aaf952c79f9629da1df9d5d600ca0ead3094 | |
parent | 46a1d921f10445da80c9a2398cfe57d0f4553533 (diff) |
Check the node Add operator's type property before attempting to create a new node. This prevents python exceptions when calling it from the search menu, where the node type is unspecified.
Reported by Sebastian Koenig in unrelated bug report #36968.
-rw-r--r-- | release/scripts/startup/bl_operators/node.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/release/scripts/startup/bl_operators/node.py b/release/scripts/startup/bl_operators/node.py index 9b629c3f976..77978c71ed9 100644 --- a/release/scripts/startup/bl_operators/node.py +++ b/release/scripts/startup/bl_operators/node.py @@ -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 |