From 65f94bcc0cf98ffee0bc78e9543aba172a2371e6 Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Tue, 25 Jun 2024 11:19:04 +0500 Subject: [PATCH] Fix for console errors in a0e5d350b when no material active --- src/blenderbim/blenderbim/bim/module/style/ui.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/blenderbim/blenderbim/bim/module/style/ui.py b/src/blenderbim/blenderbim/bim/module/style/ui.py index eb25db8035..0403a55954 100644 --- a/src/blenderbim/blenderbim/bim/module/style/ui.py +++ b/src/blenderbim/blenderbim/bim/module/style/ui.py @@ -293,13 +293,13 @@ class BIM_UL_styles(UIList): class BIM_PT_style(Panel): bl_label = "Style" bl_idname = "BIM_PT_style" - bl_space_type = 'PROPERTIES' - bl_region_type = 'WINDOW' + bl_space_type = "PROPERTIES" + bl_region_type = "WINDOW" bl_context = "material" @classmethod def poll(cls, context): - return bool(tool.Ifc.get() and context.material.BIMMaterialProperties.ifc_style_id) + return bool(tool.Ifc.get() and (material := context.material) and material.BIMMaterialProperties.ifc_style_id) def draw(self, context): # NOTE: this UI is needed only to indicate whether blender material is linked to IFC