From 3d0c9378c12c3db437cb0910e417b273388a8471 Mon Sep 17 00:00:00 2001 From: Thomas Krijnen Date: Sat, 9 Jan 2021 11:49:30 +0100 Subject: [PATCH] Quickfix #1246 --- src/ifcparse/IfcParse.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/ifcparse/IfcParse.cpp b/src/ifcparse/IfcParse.cpp index 9cc4976d6e..2769dbcf61 100644 --- a/src/ifcparse/IfcParse.cpp +++ b/src/ifcparse/IfcParse.cpp @@ -1866,7 +1866,12 @@ void IfcFile::removeEntity(IfcUtil::IfcBaseClass* entity) { if (entity->declaration().is(*ifcroot_type_)) { const std::string global_id = *entity->data().getArgument(0); - byguid.erase(byguid.find(global_id)); + auto it = byguid.find(global_id); + if (it != byguid.end()) { + byguid.erase(it); + } else { + Logger::Warning("GlobalId on rooted instance not encountered in map"); + } } byid.erase(byid.find(id));