From 3adfc63b65497efe3d5fa53281b6b27e50fdeff6 Mon Sep 17 00:00:00 2001 From: Dion Moult Date: Thu, 13 Jul 2023 11:27:01 +1000 Subject: [PATCH] Fix #3432. Bug where null applicable occurrence of a type product caused the annotation tool to fail. --- src/blenderbim/blenderbim/tool/drawing.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/blenderbim/blenderbim/tool/drawing.py b/src/blenderbim/blenderbim/tool/drawing.py index c895a175f1..19d549a903 100644 --- a/src/blenderbim/blenderbim/tool/drawing.py +++ b/src/blenderbim/blenderbim/tool/drawing.py @@ -151,7 +151,11 @@ class Drawing(blenderbim.core.tool.Drawing): if element_type == "IfcAnnotation" and element.ObjectType in object_types: return True - if element_type == "IfcTypeProduct" and element.ApplicableOccurrence.startswith("IfcAnnotation/"): + if ( + element_type == "IfcTypeProduct" + and element.ApplicableOccurrence + and element.ApplicableOccurrence.startswith("IfcAnnotation/") + ): applicable_object_type = element.ApplicableOccurrence.split("/")[1] if applicable_object_type in object_types: return True