From 8dab1810c74082de5c63cd98e3b0d1be8501baa1 Mon Sep 17 00:00:00 2001 From: Thomas Krijnen Date: Tue, 11 Oct 2022 10:48:53 +0200 Subject: [PATCH] #2486 #1861 Don't fail on overwriting header values --- src/ifcparse/IfcParse.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ifcparse/IfcParse.cpp b/src/ifcparse/IfcParse.cpp index 780b6985bd..2669a71762 100644 --- a/src/ifcparse/IfcParse.cpp +++ b/src/ifcparse/IfcParse.cpp @@ -1438,7 +1438,7 @@ void IfcEntityInstanceData::setArgument(size_t i, Argument* a, IfcUtil::Argument if (this->file) { // Deregister old attribute guid in file guid map. - if (i == 0 && this->file->ifcroot_type() && this->type()->is(*this->file->ifcroot_type())) { + if (i == 0 && this->type() && this->file->ifcroot_type() && this->type()->is(*this->file->ifcroot_type())) { try { auto guid = (std::string) *current_attribute; auto it = this->file->internal_guid_map().find(guid); @@ -1467,7 +1467,7 @@ void IfcEntityInstanceData::setArgument(size_t i, Argument* a, IfcUtil::Argument // Register new attribute guid in guid map if (this->file) { - if (i == 0 && this->file->ifcroot_type() && this->type()->is(*this->file->ifcroot_type())) { + if (i == 0 && this->type() && this->file->ifcroot_type() && this->type()->is(*this->file->ifcroot_type())) { try { auto guid = (std::string) *new_attribute; auto it = this->file->internal_guid_map().find(guid);