From c0c7727f36dda6bbefca611f58588c8a3b206cc9 Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Fri, 1 Dec 2023 16:06:09 +0500 Subject: [PATCH] fix poll errors --- src/blenderbim/blenderbim/bim/module/drawing/ui.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/blenderbim/blenderbim/bim/module/drawing/ui.py b/src/blenderbim/blenderbim/bim/module/drawing/ui.py index 10b8095af1..2ccdb9ae8c 100644 --- a/src/blenderbim/blenderbim/bim/module/drawing/ui.py +++ b/src/blenderbim/blenderbim/bim/module/drawing/ui.py @@ -107,7 +107,11 @@ class BIM_PT_element_filters(Panel): @classmethod def poll(cls, context): - return context.scene.camera and hasattr(context.active_object.data, "BIMCameraProperties") + return ( + context.scene.camera + and context.active_object + and hasattr(context.active_object.data, "BIMCameraProperties") + ) def draw(self, context): if not ElementFiltersData.is_loaded: @@ -157,7 +161,11 @@ class BIM_PT_drawing_underlay(Panel): @classmethod def poll(cls, context): - return context.scene.camera and hasattr(context.active_object.data, "BIMCameraProperties") + return ( + context.scene.camera + and context.active_object + and hasattr(context.active_object.data, "BIMCameraProperties") + ) def draw(self, context): layout = self.layout