Catch decomposition errors #8149

This commit is contained in:
Thomas Krijnen
2026-06-09 21:35:40 +02:00
parent 3cb20035ae
commit 0132ba39bb
+8 -2
View File
@@ -197,8 +197,14 @@ std::vector<express::Base> mapping::find_openings(const express::Base& inst) {
// Only aggregation, not nesting is considered.
break;
}
auto rel_obdef = decomposes.front().as<IfcSchema::IfcRelAggregates>().RelatingObject();
if (rel_obdef.as<IfcSchema::IfcElement>() && !rel_obdef.as<IfcSchema::IfcFeatureElementSubtraction>()) {
express::Base rel_obdef;
try {
rel_obdef = decomposes.front().as<IfcSchema::IfcRelAggregates>().RelatingObject();
} catch (const std::exception&) {
// exception already logged as part of handling of placement
break;
}
if (rel_obdef && rel_obdef.as<IfcSchema::IfcElement>() && !rel_obdef.as<IfcSchema::IfcFeatureElementSubtraction>()) {
auto element = rel_obdef.as<IfcSchema::IfcElement>();
auto rels = element.HasOpenings();
for (auto& rel : rels) {