forked from bartvdbraak/blender
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.
This commit is contained in:
parent
46a1d921f1
commit
96f4ee03d4
@ -113,8 +113,11 @@ class NodeAddOperator():
|
|||||||
|
|
||||||
# Default execute simply adds a node
|
# Default execute simply adds a node
|
||||||
def execute(self, context):
|
def execute(self, context):
|
||||||
self.create_node(context)
|
if self.properties.is_property_set("type"):
|
||||||
return {'FINISHED'}
|
self.create_node(context)
|
||||||
|
return {'FINISHED'}
|
||||||
|
else:
|
||||||
|
return {'CANCELLED'}
|
||||||
|
|
||||||
# Default invoke stores the mouse position to place the node correctly
|
# Default invoke stores the mouse position to place the node correctly
|
||||||
# and optionally invokes the transform operator
|
# and optionally invokes the transform operator
|
||||||
|
Loading…
Reference in New Issue
Block a user