[icinga-checkins] icinga.org: icingaweb2-module-director/master: DirectorObjectForm: getSentOrObjectValue should...

git at icinga.org git at icinga.org
Thu Jun 16 15:09:51 CEST 2016


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

Author: Thomas Gelf <thomas at gelf.net>
Date:   Thu Jun 16 14:17:40 2016 +0200

DirectorObjectForm: getSentOrObjectValue should...

...not fail on missing elements

---

 library/Director/Web/Form/DirectorObjectForm.php |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/library/Director/Web/Form/DirectorObjectForm.php b/library/Director/Web/Form/DirectorObjectForm.php
index bf9df16..5c90235 100644
--- a/library/Director/Web/Form/DirectorObjectForm.php
+++ b/library/Director/Web/Form/DirectorObjectForm.php
@@ -379,8 +379,6 @@ abstract class DirectorObjectForm extends QuickForm
             $this->addField($field, $value, $inheritedValue, $inheritFrom);
         }
 
-
-
         foreach ($checkFields as $field) {
             $varname = $field->varname;
             if (property_exists($vars, $varname)) {
@@ -968,7 +966,7 @@ abstract class DirectorObjectForm extends QuickForm
             return $objectProperty;
         }
 
-        if (!$this->valueIsEmpty($val = $this->getElement($name)->getValue())) {
+        if ($el = $this->getElement($name) && !$this->valueIsEmpty($val = $el->getValue())) {
             return $val;
         }
 



More information about the icinga-checkins mailing list