From 4b32381192fcd4d2b77831a18ab5f5081ed0e5d8 Mon Sep 17 00:00:00 2001 From: Thomas Krijnen Date: Thu, 21 Mar 2024 09:44:40 +0100 Subject: [PATCH] Don't fail on product without placement --- src/ifcgeom/mapping/IfcProduct.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/ifcgeom/mapping/IfcProduct.cpp b/src/ifcgeom/mapping/IfcProduct.cpp index 5c48dbfe6d..03cf3555ed 100644 --- a/src/ifcgeom/mapping/IfcProduct.cpp +++ b/src/ifcgeom/mapping/IfcProduct.cpp @@ -8,7 +8,12 @@ taxonomy::ptr mapping::map_impl(const IfcSchema::IfcProduct* inst) { // @todo decide on this, what happens in the product mapping? // currently things like openings, layers and materials are processed in the converter auto c = taxonomy::make(); - c->matrix = taxonomy::cast(map(inst->ObjectPlacement())); + if (inst->ObjectPlacement()) { + c->matrix = taxonomy::cast(map(inst->ObjectPlacement())); + } else { + // @todo Otherwise we get crashes in the serializer, but maybe fix them there..? + c->matrix = taxonomy::make(); + } return c; /*