From c859055221b5c54a010ed1036837ddc1a22b3ca0 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Wed, 5 Oct 2016 17:20:25 +0000 Subject: [PATCH] CustomVariables: unset var if set to plain null ...but still allow for Null variables --- library/Director/CustomVariable/CustomVariables.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/library/Director/CustomVariable/CustomVariables.php b/library/Director/CustomVariable/CustomVariables.php index f5de9b72..b080ebb9 100644 --- a/library/Director/CustomVariable/CustomVariables.php +++ b/library/Director/CustomVariable/CustomVariables.php @@ -77,6 +77,10 @@ class CustomVariables implements Iterator, Countable, IcingaConfigRenderer if ($value instanceof CustomVariable) { $value = clone($value); } else { + if ($value === null) { + $this->__unset($key); + return $this; + } $value = CustomVariable::create($key, $value); }