diff --git a/src/ifcgeom/mapping/IfcDerivedProfileDef.cpp b/src/ifcgeom/mapping/IfcDerivedProfileDef.cpp index 6716e300ac..18091d3d2c 100644 --- a/src/ifcgeom/mapping/IfcDerivedProfileDef.cpp +++ b/src/ifcgeom/mapping/IfcDerivedProfileDef.cpp @@ -23,6 +23,11 @@ using namespace ifcopenshell::geometry; taxonomy::ptr mapping::map_impl(const IfcSchema::IfcDerivedProfileDef* inst) { auto it = map(inst->ParentProfile()); + if (it == nullptr) { + return nullptr; + } + // @todo we mutate it so we need to clone otherwise we alter the cached item. + it = taxonomy::item::ptr(it->clone_()); taxonomy::matrix4::ptr m = taxonomy::cast(map(inst->Operator())); if (!taxonomy::cast(it)->matrix) { // @todo should this not be initialized by default? matrix4 already has a 'lazy identity' mechanism.