fix PHP 8.0 TypeError: array_keys(): Argument #1 ($array) must be of type array, null given

This commit is contained in:
Ralf Becker 2021-10-11 13:19:46 +02:00
parent fdc5421561
commit 88a67d7442

View File

@ -2181,7 +2181,7 @@ class calendar_uiforms extends calendar_ui
} }
$user_and_memberships = $GLOBALS['egw']->accounts->memberships($user, true); $user_and_memberships = $GLOBALS['egw']->accounts->memberships($user, true);
$user_and_memberships[] = $user; $user_and_memberships[] = $user;
if (!array_intersect(array_keys($event['participants']), $user_and_memberships)) if (!array_intersect(array_keys($event['participants'] ?? []), $user_and_memberships))
{ {
$event['error'] .= ($event['error'] ? "\n" : '').lang('You are not invited to that event!'); $event['error'] .= ($event['error'] ? "\n" : '').lang('You are not invited to that event!');
if ($event['id']) if ($event['id'])