IcingaDB: handle null (Empty) for value/set_if/separator in command arguments

Icinga 2 treats null (Empty) as if the corresponding attribute is not
specified. However, without this commit, it would serialize the value as "null"
(i.e. type string), so that it ends up in the database as this string instead
of NULL. This commit adds handling for ValueEmpty so that is serialized as JSON
null value and ends up in the database as NULL.
This commit is contained in:
Julian Brost 2022-05-16 12:54:26 +02:00
parent f46d474e2f
commit f110e26635
1 changed files with 1 additions and 0 deletions

View File

@ -996,6 +996,7 @@ void IcingaDB::InsertObjectDependencies(const ConfigObject::Ptr& object, const S
// Stringify if set.
if (values->Get(attr, &value)) {
switch (value.GetType()) {
case ValueEmpty:
case ValueString:
break;
case ValueObject: