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 2cd030afdb
commit 0ab30a1b3a

View File

@ -2171,7 +2171,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']);