Fix crash where IFCTester read directly from IFC in the UI

This commit is contained in:
Dion Moult
2023-09-19 18:15:56 +10:00
parent a7f33d8172
commit af9ce9d8fd
5 changed files with 15 additions and 17 deletions
+6 -3
View File
@@ -436,13 +436,16 @@ class Bcf(Json):
continue
for failure in requirement["failed_entities"]:
element = failure["element"]
title_components = [
title_components = []
for title_component in [
element.is_a(),
getattr(element, "Name", None) or "Unnamed",
getattr(element, "Name", "") or "Unnamed",
failure.get("reason", "No reason"),
getattr(element, "GlobalId", ""),
getattr(element, "Tag", ""),
]
]:
if title_component:
title_components.append(title_component)
title = " - ".join(title_components)
description = f'{specification["name"]} - {requirement["description"]}'
topic = bcfxml.add_topic(title, description, "IfcTester")