Remove properties when set to an empty string

Fixes #3109.
This commit is contained in:
Dustin J. Mitchell 2023-05-28 21:13:01 +00:00 committed by Dustin J. Mitchell
parent 6cd5bf1237
commit a69b0c8032
2 changed files with 17 additions and 1 deletions

View file

@ -169,7 +169,12 @@ void TDB2::modify (Task& task)
update = true;
}
if (update) {
tctask.set_value(k, make_optional (v_new));
// An empty string indicates the value should be removed.
if (v_new == "") {
tctask.set_value(k, {});
} else {
tctask.set_value(k, make_optional (v_new));
}
}
}