Fix: improve poll for NodePanelOperator

Also check for actually being in the Node Editor, otherwise we get
errors from other editors (e.g. on F3 search) due to missing
'edit_tree'.

Pull Request: https://projects.blender.org/blender/blender/pulls/109125
This commit is contained in:
Philipp Oeser
2023-06-19 15:18:56 +02:00
committed by Philipp Oeser
parent 550c61d34f
commit 83990475a7

View File

@@ -250,13 +250,10 @@ class NODE_OT_tree_path_parent(Operator):
class NodePanelOperator():
@classmethod
def poll(cls, context):
snode = context.space_data
if snode is None:
space = context.space_data
if not space or space.type != 'NODE_EDITOR' or not space.edit_tree:
return False
tree = snode.edit_tree
if tree is None:
return False
if tree.is_embedded_data:
if space.edit_tree.is_embedded_data:
return False
return True