From 5a44a8e32546af6f93ddd3cd02ed7c3c71a14047 Mon Sep 17 00:00:00 2001 From: Thomas Krijnen Date: Wed, 11 Sep 2024 20:13:50 +0200 Subject: [PATCH] Defensiveness against invalid data --- src/ifcparse/IfcParse.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ifcparse/IfcParse.cpp b/src/ifcparse/IfcParse.cpp index 0ea64c2f78..a922775977 100644 --- a/src/ifcparse/IfcParse.cpp +++ b/src/ifcparse/IfcParse.cpp @@ -709,7 +709,7 @@ void IfcParse::IfcFile::load(unsigned entity_instance_name, const IfcParse::enti load(entity_instance_name, entity, context.push(), attribute_index == -1 ? (int) attribute_index_within_data : attribute_index); } else { return_value++; - if (TokenFunc::isIdentifier(next)) { + if (TokenFunc::isIdentifier(next) && entity) { register_inverse(entity_instance_name, entity, next, attribute_index == -1 ? attribute_index_within_data : attribute_index); }