From b1706f2eac09b3266ff9d8296a17889854d9980a Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Fri, 3 May 2024 15:42:56 +0500 Subject: [PATCH] fix error launching type manager in empty project --- src/blenderbim/blenderbim/bim/module/model/ui.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/blenderbim/blenderbim/bim/module/model/ui.py b/src/blenderbim/blenderbim/bim/module/model/ui.py index 9a174f11ff..7d7e8b679f 100644 --- a/src/blenderbim/blenderbim/bim/module/model/ui.py +++ b/src/blenderbim/blenderbim/bim/module/model/ui.py @@ -56,8 +56,11 @@ class LaunchTypeManager(bpy.types.Operator): ifc_class = props.ifc_class or AuthoringData.data["ifc_element_type"] else: ifc_class = AuthoringData.data["ifc_element_type"] - props.type_class = ifc_class - bpy.ops.bim.load_type_thumbnails(ifc_class=ifc_class, offset=0, limit=9) + + # will be None if project has no types + if ifc_class is not None: + props.type_class = ifc_class + bpy.ops.bim.load_type_thumbnails(ifc_class=ifc_class, offset=0, limit=9) return context.window_manager.invoke_popup(self, width=550) def draw(self, context):