Don't fail on empty ReferencedSource in IfcTester

This commit is contained in:
Thomas Krijnen
2025-01-05 14:40:27 +01:00
parent 7b21858cd4
commit 1b6ee26854
2 changed files with 3 additions and 2 deletions
@@ -54,7 +54,7 @@ def get_references(element: ifcopenshell.entity_instance, should_inherit=True) -
def get_classification(reference: ifcopenshell.entity_instance) -> ifcopenshell.entity_instance:
if reference.is_a("IfcClassification"):
return reference
return get_classification(reference.ReferencedSource)
return get_classification(reference.ReferencedSource) if reference.ReferencedSource is not None else None
def get_inherited_references(reference: Optional[ifcopenshell.entity_instance]) -> list[ifcopenshell.entity_instance]: