N°4326 - Improve robustness of DesignerComboField::SetAllowedValues()

This commit is contained in:
Molkobain
2021-09-23 22:24:16 +02:00
parent dcf4053c30
commit eb5e5591d7

View File

@@ -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;
}