Add case for null $caldav_event

This commit is contained in:
Alex Tselegidis 2024-12-18 09:35:02 +02:00
parent c8aef548ff
commit 0522e67444

View file

@ -183,7 +183,7 @@ class Caldav extends EA_Controller
try { try {
$caldav_event = $CI->caldav_sync->get_event($provider, $local_event['id_caldav_calendar']); $caldav_event = $CI->caldav_sync->get_event($provider, $local_event['id_caldav_calendar']);
if ($caldav_event['status'] === 'CANCELLED') { if (!$caldav_event || $caldav_event['status'] === 'CANCELLED') {
throw new Exception('Event is cancelled, remove the record from Easy!Appointments.'); throw new Exception('Event is cancelled, remove the record from Easy!Appointments.');
} }