From 2bfe67c8ab323aa4438c0322bcdd504e9b4332d5 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Thu, 11 Jan 2024 10:14:48 +0100 Subject: [PATCH] fix(caldav): only call getTimestamp() on actual DateTime data For some reason the value of $component['DTSTART'][0] may not be a DateTimeImmutable Closes #42464 Signed-off-by: Thomas Citharel --- apps/dav/lib/CalDAV/Status/StatusService.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/apps/dav/lib/CalDAV/Status/StatusService.php b/apps/dav/lib/CalDAV/Status/StatusService.php index 24e929f9d0e73..9dccd4e77a3fb 100644 --- a/apps/dav/lib/CalDAV/Status/StatusService.php +++ b/apps/dav/lib/CalDAV/Status/StatusService.php @@ -106,8 +106,7 @@ public function processCalendarStatus(string $userId): void { if (isset($component['DTSTART']) && $userStatusTimestamp !== null) { /** @var DateTimeImmutable $dateTime */ $dateTime = $component['DTSTART'][0]; - $timestamp = $dateTime->getTimestamp(); - if($userStatusTimestamp > $timestamp) { + if($dateTime instanceof DateTimeImmutable && $userStatusTimestamp > $dateTime->getTimestamp()) { return false; } }