BUGFIX: Only unset array key if it exists

This commit is contained in:
Daniel Siepmann 2017-07-19 10:31:01 +02:00
parent 3da68c2e49
commit 5c927e9dda
No known key found for this signature in database
GPG key ID: 33D6629915560EF4

View file

@ -178,7 +178,12 @@ class SettingsValidator extends AbstractValidator
*/ */
protected function handleValidationGroups(array &$validatorConfig) protected function handleValidationGroups(array &$validatorConfig)
{ {
if ($validatorConfig['validator'] !== 'DigiComp.SettingValidator:Settings' || empty($validatorConfig['options']['validationGroups'])) { if (isset($validatorConfig['options']['validationGroups'])
&& (
$validatorConfig['validator'] !== 'DigiComp.SettingValidator:Settings'
|| empty($validatorConfig['options']['validationGroups'])
)
) {
unset($validatorConfig['options']['validationGroups']); unset($validatorConfig['options']['validationGroups']);
} }
} }