Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <campbell@blender.org>2022-08-30 13:56:59 +0300
committerCampbell Barton <campbell@blender.org>2022-08-30 14:06:17 +0300
commit524d9a3e2fa1821d0f846877ecb3936b7c3794dd (patch)
tree8440c7742469618a5e06944da53504af2aeedc5a /release
parent34e30baedf7eee625deeba3ab1209be7efbaaf04 (diff)
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.
Diffstat (limited to 'release')
-rw-r--r--release/scripts/startup/bl_operators/userpref.py4
1 files changed, 4 insertions, 0 deletions
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')