Skip to content
Snippets Groups Projects

Ensure domain list isn't null before validating

1 file
+ 1
1
Compare changes
  • Side-by-side
  • Inline
+ 1
1
@@ -97,7 +97,7 @@ class SettingsForm extends ConfigFormBase {
foreach (array_keys($checks) as $key) {
$element = $key . '_domain_list';
$value = $form_state->getValue($element);
if (preg_match('/@+/', $value)) {
if ($value && preg_match('/@+/', $value)) {
$form_state->setErrorByName($element, $this->t('Use domain names only (the part after "@" in an email address)'));
}
}
Loading