[icinga-checkins] icinga.org: icingaweb2-module-director/master: CustomVariables: unset var if set to plain null

git at icinga.org git at icinga.org
Wed Oct 5 22:13:57 CEST 2016


Module: icingaweb2-module-director
Branch: master
Commit: c859055221b5c54a010ed1036837ddc1a22b3ca0
URL:    https://git.icinga.org/?p=icingaweb2-module-director.git;a=commit;h=c859055221b5c54a010ed1036837ddc1a22b3ca0

Author: Thomas Gelf <thomas at gelf.net>
Date:   Wed Oct  5 17:20:25 2016 +0000

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 f5de9b7..b080ebb 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);
         }
 



More information about the icinga-checkins mailing list