From 83990475a736d14fdab7af3de2cf9bd6461fa7fc Mon Sep 17 00:00:00 2001 From: Philipp Oeser Date: Mon, 19 Jun 2023 15:18:56 +0200 Subject: [PATCH] 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 --- scripts/startup/bl_operators/node.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/scripts/startup/bl_operators/node.py b/scripts/startup/bl_operators/node.py index b8c5dfc3ac9..f5dfae789a4 100644 --- a/scripts/startup/bl_operators/node.py +++ b/scripts/startup/bl_operators/node.py @@ -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