diff --git a/library/Icingadb/Model/CustomvarFlat.php b/library/Icingadb/Model/CustomvarFlat.php index 97b0254fd..c2ce52b41 100644 --- a/library/Icingadb/Model/CustomvarFlat.php +++ b/library/Icingadb/Model/CustomvarFlat.php @@ -126,7 +126,7 @@ public function unFlattenVars(Traversable $flattenedVars): array // Since empty custom vars of type dictionaries and arrays have null values in customvar_flat table, // we won't be able to render them as such. Therefore, we have to use the value of the `customvar` // table if it's not null, otherwise the current value, which is a "null" string. - $data[$step] = $source[$step] ?? $value; + $data[$step] = $value === null && $source[$step] ?? null === [] ? $source[$step] : $value; } };