Skip to content

Commit

Permalink
fix(caldav): only call getTimestamp() on actual DateTime data
Browse files Browse the repository at this point in the history
For some reason the value of $component['DTSTART'][0] may not be a DateTimeImmutable

Closes #42464

Signed-off-by: Thomas Citharel <[email protected]>
  • Loading branch information
tcitworld authored and miaulalala committed Feb 2, 2024
1 parent 63f327c commit 2bfe67c
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions apps/dav/lib/CalDAV/Status/StatusService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down

0 comments on commit 2bfe67c

Please sign in to comment.