From 199863f9a4927df4d608391e7e2cc1bf24bd995a Mon Sep 17 00:00:00 2001 From: Wagram Airiian Date: Fri, 15 Nov 2024 12:17:30 +0100 Subject: [PATCH] Fix setters to accept null validity --- libs/model/src/attr.cpp | 2 +- libs/model/src/relation.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libs/model/src/attr.cpp b/libs/model/src/attr.cpp index 80a3b68..70c3c35 100644 --- a/libs/model/src/attr.cpp +++ b/libs/model/src/attr.cpp @@ -78,7 +78,7 @@ model_ptr Attribute::validityOrNull() const void Attribute::setValidity(const model_ptr& validities) const { - data_->validities_ = validities->addr(); + data_->validities_ = validities ? validities->addr() : ModelNodeAddress();; } } diff --git a/libs/model/src/relation.cpp b/libs/model/src/relation.cpp index b19e8cd..e686e3d 100644 --- a/libs/model/src/relation.cpp +++ b/libs/model/src/relation.cpp @@ -59,7 +59,7 @@ model_ptr Relation::sourceValidityOrNull() const void Relation::setSourceValidity(const model_ptr& validityGeom) { - data_->sourceValidity_ = validityGeom->addr(); + data_->sourceValidity_ = validityGeom ? validityGeom->addr() : ModelNodeAddress(); } model_ptr Relation::targetValidity() @@ -82,7 +82,7 @@ model_ptr Relation::targetValidityOrNull() const void Relation::setTargetValidity(const model_ptr& validityGeom) { - data_->targetValidity_ = validityGeom->addr(); + data_->targetValidity_ = validityGeom ? validityGeom->addr() : ModelNodeAddress();; } std::string_view Relation::name() const