fix PHP 8.x TypeError: array_filter(): Argument #1 ($array) must be of type array, null given

This commit is contained in:
ralf 2022-11-24 10:06:14 +01:00
parent 24118a2a9c
commit b2e0e176a5

View File

@ -2178,7 +2178,7 @@ class calendar_uiforms extends calendar_ui
// check if mail is from extern organizer
$from_extern_organizer = false;
if (strtolower($ical_method) !== 'reply' &&
($extern_organizer = !empty($ical_sender) ? array_filter($existing_event['participants'], static function($status, $user)
($extern_organizer = !empty($ical_sender) ? array_filter($existing_event['participants'] ?? [], static function($status, $user)
{
calendar_so::split_status($status, $quantity, $role);
return $role === 'CHAIR' && is_string($user) && in_array($user[0], ['e', 'c']);