From cfc1ddee5e00ce78a59e00e604f0ce50f72f5213 Mon Sep 17 00:00:00 2001 From: Thomas Krijnen Date: Sat, 4 Sep 2021 14:27:46 +0200 Subject: [PATCH] #1676 null handling in inverses --- src/ifcparse/IfcParse.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ifcparse/IfcParse.cpp b/src/ifcparse/IfcParse.cpp index 66ee47e5e4..8d1b036573 100644 --- a/src/ifcparse/IfcParse.cpp +++ b/src/ifcparse/IfcParse.cpp @@ -2211,7 +2211,9 @@ IfcEntityList::ptr IfcFile::getInverse(int instance_id, const IfcParse::declarat if (valid && attribute_index >= 0) { try { Argument* arg = (*it)->data().getArgument(attribute_index); - if (arg->type() == IfcUtil::Argument_ENTITY_INSTANCE) { + if (arg->isNull()) { + valid = false; + } else if (arg->type() == IfcUtil::Argument_ENTITY_INSTANCE) { valid = instance == *arg; } else if (arg->type() == IfcUtil::Argument_AGGREGATE_OF_ENTITY_INSTANCE) { IfcEntityList::ptr li = *arg;