diff --git a/src/ifcgeom/mapping/mapping.cpp b/src/ifcgeom/mapping/mapping.cpp index 42c41c1f99..9e24b59ef9 100644 --- a/src/ifcgeom/mapping/mapping.cpp +++ b/src/ifcgeom/mapping/mapping.cpp @@ -132,7 +132,7 @@ bool mapping::reuse_ok_(const std::vector& products) { return true; } - std::set associated_single_materials; + std::set> associated_single_materials; for (auto& product : products) { if (!settings_.get().get() && !find_openings(product).empty()) { @@ -151,8 +151,8 @@ bool mapping::reuse_ok_(const std::vector& products) { } } - // Note that this can be a nullptr (!), but the fact that set size should be one still holds - associated_single_materials.insert(get_single_material_association(product)); + auto mat = get_single_material_association(product); + associated_single_materials.insert(mat ? std::optional{mat} : std::nullopt); if (associated_single_materials.size() > 1) return false; }