From eb5e5591d737c9940ee86c1afe355d3ae438703d Mon Sep 17 00:00:00 2001 From: Molkobain Date: Thu, 23 Sep 2021 22:24:16 +0200 Subject: [PATCH] =?UTF-8?q?N=C2=B04326=20-=20Improve=20robustness=20of=20D?= =?UTF-8?q?esignerComboField::SetAllowedValues()?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/forms.class.inc.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/application/forms.class.inc.php b/application/forms.class.inc.php index 6fe7f56e4..20617dbd5 100644 --- a/application/forms.class.inc.php +++ b/application/forms.class.inc.php @@ -1217,9 +1217,14 @@ class DesignerComboField extends DesignerFormField return cmdbAbstractObject::ENUM_INPUT_TYPE_DROPDOWN_RAW; } } - - public function SetAllowedValues($aAllowedValues) + + public function SetAllowedValues(?array $aAllowedValues) { + // Make sure to have an actual array for values + if (is_null($aAllowedValues)) { + $aAllowedValues = []; + } + $this->aAllowedValues = $aAllowedValues; }