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 b7ef766ebb
commit c3fb7eda8e

View File

@ -2181,7 +2181,7 @@ class calendar_uiforms extends calendar_ui
}
$user_and_memberships = $GLOBALS['egw']->accounts->memberships($user, true);
$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!');
if ($event['id'])