RoleForm: Don't pass null to `preg_match`

This commit is contained in:
Johannes Meyer 2022-03-29 16:35:23 +02:00
parent ba677de0c6
commit 1422f50fad
1 changed files with 1 additions and 1 deletions

View File

@ -319,7 +319,7 @@ class RoleForm extends RepositoryForm
'users' => $role->users,
'groups' => $role->groups,
'unrestricted' => $role->unrestricted,
self::WILDCARD_NAME => (bool) preg_match('~(?>^|,)\*(?>$|,)~', $role->permissions)
self::WILDCARD_NAME => $role->permissions && preg_match('~(?>^|,)\*(?>$|,)~', $role->permissions)
];
if (! empty($role->permissions) || ! empty($role->refusals)) {