Handle storage of nullptr as a proper Blank type in variant #5308

This commit is contained in:
Thomas Krijnen
2024-09-05 14:38:21 +02:00
parent 56428eb605
commit 12318fbfc2
+9 -1
View File
@@ -1149,7 +1149,15 @@ void IfcUtil::IfcBaseClass::set_attribute_value(size_t i, const T& t) {
apply_individual_instance_visitor(current_attribute, (int) i).apply(visitor);
}
data_.storage_.set(i, t);
if constexpr (std::is_pointer_v<T>) {
if (t) {
data_.storage_.set(i, t);
} else {
data_.storage_.set(i, Blank{});
}
} else {
data_.storage_.set(i, t);
}
auto new_attribute = data_.get_attribute_value(i);
if (file_ != nullptr) {