From 508a2d812501d8113ef2043fd114cbc89c10cede Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 13 Jun 2023 14:33:15 +1000 Subject: [PATCH] Cleanup: avoid 2x context modifier lookups --- scripts/startup/bl_operators/geometry_nodes.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/scripts/startup/bl_operators/geometry_nodes.py b/scripts/startup/bl_operators/geometry_nodes.py index 035e374b8ec..aa85de2b44a 100644 --- a/scripts/startup/bl_operators/geometry_nodes.py +++ b/scripts/startup/bl_operators/geometry_nodes.py @@ -44,10 +44,9 @@ def geometry_modifier_poll(context): def get_context_modifier(context): - # Context only has a 'modifier' attribute in the modifier extra operators dropdown. - if hasattr(context, 'modifier'): - modifier = context.modifier - else: + # Context only has a "modifier" attribute in the modifier extra operators drop-down. + modifier = getattr(context, "modifier", ...) + if modifier is ...: ob = context.object if ob is None: return False