[icinga-checkins] icinga.org: icingaweb2-module-director/fiddle/mfrosch: Import: Do not run modifiers on unset properties

git at icinga.org git at icinga.org
Wed May 25 11:25:29 CEST 2016


Module: icingaweb2-module-director
Branch: fiddle/mfrosch
Commit: 44ea86cca5782742f2b7c4d576bc2a3567d41c3f
URL:    https://git.icinga.org/?p=icingaweb2-module-director.git;a=commit;h=44ea86cca5782742f2b7c4d576bc2a3567d41c3f

Author: Markus Frosch <lazyfrosch at icinga.org>
Date:   Wed May 25 11:12:10 2016 +0200

Import: Do not run modifiers on unset properties

---

 library/Director/Import/Import.php |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/library/Director/Import/Import.php b/library/Director/Import/Import.php
index 7b6fcb7..3f6b970 100644
--- a/library/Director/Import/Import.php
+++ b/library/Director/Import/Import.php
@@ -174,6 +174,9 @@ class Import
         foreach ($this->data as & $row) {
             foreach ($modifiers as $key => $mods) {
                 foreach ($mods as $mod) {
+                    if (! property_exists($row, $key)) {
+                        continue;
+                    }
                     if (is_array($row->$key)) {
                         foreach ($row->$key as & $k) {
                             $k = $mod->transform($k);



More information about the icinga-checkins mailing list