From 4e544a89d65161abe927b152097c318d3e3e4ee4 Mon Sep 17 00:00:00 2001 From: Habib Gahbiche Date: Thu, 30 Jan 2025 00:28:22 +0100 Subject: [PATCH] Fix #133780: Menu search Python error in terminal `poll()` method must check properly for space type. Pull Request: https://projects.blender.org/blender/blender/pulls/133781 --- scripts/startup/bl_operators/node.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/scripts/startup/bl_operators/node.py b/scripts/startup/bl_operators/node.py index 0fdc7d4044c..62810ddaa14 100644 --- a/scripts/startup/bl_operators/node.py +++ b/scripts/startup/bl_operators/node.py @@ -429,7 +429,10 @@ class NODE_OT_viewer_shortcut_set(Operator): @classmethod def poll(self, context): - return context.space_data.tree_type == 'CompositorNodeTree' + space = context.space_data + return (space.type == 'NODE_EDITOR' and + space.node_tree is not None and + space.tree_type == 'CompositorNodeTree') def execute(self, context): nodes = context.space_data.edit_tree.nodes @@ -483,7 +486,10 @@ class NODE_OT_viewer_shortcut_get(Operator): @classmethod def poll(self, context): - return context.space_data.tree_type == 'CompositorNodeTree' + space = context.space_data + return (space.type == 'NODE_EDITOR' and + space.node_tree is not None and + space.tree_type == 'CompositorNodeTree') def execute(self, context): nodes = context.space_data.edit_tree.nodes