Prevent 'undefined index' warnings when optional country dropdown fields are left empty

This commit is contained in:
Joe Harvey 2019-04-25 16:25:51 +01:00 committed by Robbie Averill
parent f9094bed09
commit 418017494f

View File

@ -47,7 +47,7 @@ class EditableCountryDropdownField extends EditableFormField
public function getValueFromData($data)
{
if (isset($data[$this->Name])) {
if (isset($data[$this->Name]) && !empty($data[$this->Name])) {
$source = $this->getFormField()->getSource();
return $source[$data[$this->Name]];
}