diff --git a/src/ifcgeom/IfcGeomElement.h b/src/ifcgeom/IfcGeomElement.h index 14c321f620..698966d2d7 100644 --- a/src/ifcgeom/IfcGeomElement.h +++ b/src/ifcgeom/IfcGeomElement.h @@ -42,7 +42,13 @@ namespace IfcGeom { : settings_(settings) , matrix_(matrix) {} - const ifcopenshell::geometry::taxonomy::matrix4::ptr& data() const { return matrix_; } + const ifcopenshell::geometry::taxonomy::matrix4::ptr& data() const { + if (matrix_) { + return matrix_; + } + static ifcopenshell::geometry::taxonomy::matrix4::ptr iden = ifcopenshell::geometry::taxonomy::make(); + return iden; + } }; class Element {