UI: Handle lack of active area in NewGeometryNodeGroupTool poll

Calling F3 Menu Search while mouse is outside of the blender window
_can_ result in a console error message. This just checks for that
situation.
This commit is contained in:
Christoph Lendenfeld 2023-08-29 11:27:51 -07:00 committed by Harley Acheson
parent 6d2c7c509c
commit 468584f5e7

@ -266,6 +266,9 @@ class NewGeometryNodeGroupTool(Operator):
@classmethod
def poll(cls, context):
if not context.space_data:
# Does not exist if the search menu is called while the cursor is outside the Blender window.
return False
return context.space_data.type == 'NODE_EDITOR' and context.space_data.geometry_nodes_type == 'TOOL'
def execute(self, context):
@ -476,7 +479,7 @@ class RepeatZoneItemMoveOperator(RepeatZoneOperator, Operator):
classes = (
NewGeometryNodesModifier,
NewGeometryNodeTreeAssign,
NewGeometryNodeGroupTool,
NewGeometryNodeGroupToolNewGeometryNodeGroupTool,
MoveModifierToNodes,
SimulationZoneItemAddOperator,
SimulationZoneItemRemoveOperator,