[icinga-checkins] icinga.org: icingaweb2/master: IniWriter: don' t persist a section key if the value is null

git at icinga.org git at icinga.org
Tue Oct 18 14:22:24 CEST 2016


Module: icingaweb2
Branch: master
Commit: 9bb798c18b33bd31259722d95a2e98b11ec6006d
URL:    https://git.icinga.org/?p=icingaweb2.git;a=commit;h=9bb798c18b33bd31259722d95a2e98b11ec6006d

Author: Alexander A. Klimov <alexander.klimov at netways.de>
Date:   Wed Oct 12 11:06:04 2016 +0200

IniWriter: don't persist a section key if the value is null

refs #11743

---

 library/Icinga/File/Ini/IniWriter.php |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/library/Icinga/File/Ini/IniWriter.php b/library/Icinga/File/Ini/IniWriter.php
index 8341059..f00040e 100644
--- a/library/Icinga/File/Ini/IniWriter.php
+++ b/library/Icinga/File/Ini/IniWriter.php
@@ -149,6 +149,10 @@ class IniWriter
                 $domSection = $doc->getSection($section);
             }
             foreach ($directives as $key => $value) {
+                if ($value === null) {
+                    continue;
+                }
+
                 if ($value instanceof ConfigObject) {
                     throw new ProgrammingError('Cannot diff recursive configs');
                 }



More information about the icinga-checkins mailing list