Don't assert but just if-check for not terminating rule execution on very invalid files

This commit is contained in:
Thomas Krijnen
2023-06-01 14:06:41 +02:00
parent 9d869ebb6d
commit d60fbd2c09
@@ -197,10 +197,14 @@ def run(f, logger):
type = type.declared_type()
if isinstance(value, (list, tuple)):
assert isinstance(type, ifcopenshell.ifcopenshell_wrapper.aggregation_type)
ty = type.type_of_element()
for v in value:
check(v, ty, instance=inst)
if isinstance(type, ifcopenshell.ifcopenshell_wrapper.aggregation_type):
ty = type.type_of_element()
for v in value:
check(v, ty, instance=inst)
else:
# Let's hope a schema validation error was reported for this case
pass
elif isinstance(value, ifcopenshell.entity_instance):
if isinstance(
S.declaration_by_name(value.is_a()),