From 0a2afa48795daedb6a0a0e164490820de8669fd5 Mon Sep 17 00:00:00 2001 From: Dion Moult Date: Mon, 30 Aug 2021 21:32:03 +1000 Subject: [PATCH] Fix bug where element replacement would sometimes fail leading to various problems. --- src/ifcopenshell-python/ifcopenshell/util/element.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ifcopenshell-python/ifcopenshell/util/element.py b/src/ifcopenshell-python/ifcopenshell/util/element.py index 5404494b16..08d9aff9e6 100644 --- a/src/ifcopenshell-python/ifcopenshell/util/element.py +++ b/src/ifcopenshell-python/ifcopenshell/util/element.py @@ -97,7 +97,9 @@ def replace_attribute(element, old, new): def has_element_reference(value, element): if isinstance(value, (tuple, list)): for v in value: - return has_element_reference(v, element) + if has_element_reference(v, element): + return True + return False return value == element