Fix segfault on grid placement. Don't fail on nullptr transformation. #4832

This commit is contained in:
Thomas Krijnen
2024-06-10 21:40:39 +02:00
parent 2ccc598270
commit 6fb05fa743
+7 -1
View File
@@ -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<ifcopenshell::geometry::taxonomy::matrix4>();
return iden;
}
};
class Element {