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 <tcit@tcit.fr>
pull/42696/head
Thomas Citharel 2 years ago committed by Anna
parent 63f327c7ba
commit 2bfe67c8ab
  1. 3
      apps/dav/lib/CalDAV/Status/StatusService.php

@ -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;
}
}

Loading…
Cancel
Save