Skip to content

Commit

Permalink
Fix setters to accept null validity
Browse files Browse the repository at this point in the history
  • Loading branch information
Waguramu committed Nov 15, 2024
1 parent 5dbf63e commit 199863f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion libs/model/src/attr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ model_ptr<MultiValidity> Attribute::validityOrNull() const

void Attribute::setValidity(const model_ptr<MultiValidity>& validities) const
{
data_->validities_ = validities->addr();
data_->validities_ = validities ? validities->addr() : ModelNodeAddress();;
}

}
4 changes: 2 additions & 2 deletions libs/model/src/relation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ model_ptr<MultiValidity> Relation::sourceValidityOrNull() const

void Relation::setSourceValidity(const model_ptr<MultiValidity>& validityGeom)
{
data_->sourceValidity_ = validityGeom->addr();
data_->sourceValidity_ = validityGeom ? validityGeom->addr() : ModelNodeAddress();
}

model_ptr<MultiValidity> Relation::targetValidity()
Expand All @@ -82,7 +82,7 @@ model_ptr<MultiValidity> Relation::targetValidityOrNull() const

void Relation::setTargetValidity(const model_ptr<MultiValidity>& validityGeom)
{
data_->targetValidity_ = validityGeom->addr();
data_->targetValidity_ = validityGeom ? validityGeom->addr() : ModelNodeAddress();;
}

std::string_view Relation::name() const
Expand Down

0 comments on commit 199863f

Please sign in to comment.