]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix(caldav): only call getTimestamp() on actual DateTime data 42696/head
authorThomas Citharel <tcit@tcit.fr>
Thu, 11 Jan 2024 09:14:48 +0000 (10:14 +0100)
committerAnna <anna@nextcloud.com>
Fri, 2 Feb 2024 09:46:48 +0000 (10:46 +0100)
For some reason the value of $component['DTSTART'][0] may not be a DateTimeImmutable

Closes #42464

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
apps/dav/lib/CalDAV/Status/StatusService.php

index 24e929f9d0e7339d649d16957d11e70dddc31aeb..9dccd4e77a3fb2b9e4d618f01dc2c4dc2a2da7e1 100644 (file)
@@ -106,8 +106,7 @@ class StatusService {
                        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;
                                }
                        }