From 524d9a3e2fa1821d0f846877ecb3936b7c3794dd Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 30 Aug 2022 20:56:59 +1000 Subject: Fix error in operator poll functions - PALETTE_OT_color_add: crashed without a brush. - SCREEN_OT_actionzone: crashed without a window. - PREFERENCES_OT_studiolight_show: exception when opening prefs failed. --- release/scripts/startup/bl_operators/userpref.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'release') diff --git a/release/scripts/startup/bl_operators/userpref.py b/release/scripts/startup/bl_operators/userpref.py index 54de9c28144..ce23024fed5 100644 --- a/release/scripts/startup/bl_operators/userpref.py +++ b/release/scripts/startup/bl_operators/userpref.py @@ -1116,6 +1116,10 @@ class PREFERENCES_OT_studiolight_show(Operator): bl_label = "" bl_options = {'INTERNAL'} + @classmethod + def poll(cls, _context): + return bpy.ops.screen.userpref_show.poll() + def execute(self, context): context.preferences.active_section = 'LIGHTS' bpy.ops.screen.userpref_show('INVOKE_DEFAULT') -- cgit v1.2.3