Skip to content

Conversation

@tcitworld
Copy link
Member

For some reason the value of $component['DTSTART'][0] may not be a DateTimeImmutable.

In the case of #42464, the property is a Property\ICalendar\Date, but that extends Property\ICalendar\DateTime, so it should still give us a DateTimeImmutable, but anyway. 🤷

Follow-up to #42619 Closes #42464

@tcitworld tcitworld added bug 3. to review Waiting for reviews feature: status feature: caldav Related to CalDAV internals labels Jan 11, 2024
@tcitworld tcitworld added this to the Nextcloud 29 milestone Jan 11, 2024
@tcitworld
Copy link
Member Author

/backport to stable28

$dateTime = $component['DTSTART'][0];
$timestamp = $dateTime->getTimestamp();
if($userStatusTimestamp > $timestamp) {
if($dateTime instanceof DateTimeImmutable && $userStatusTimestamp > $dateTime->getTimestamp()) {

Check notice

Code scanning / Psalm

RedundantConditionGivenDocblockType

Docblock-defined type DateTimeImmutable for $dateTime is always DateTimeImmutable
For some reason the value of $component['DTSTART'][0] may not be a DateTimeImmutable

Closes #42464

Signed-off-by: Thomas Citharel <[email protected]>
@ChristophWurst ChristophWurst added 4. to release Ready to be released and/or waiting for tests to finish and removed 3. to review Waiting for reviews labels Feb 2, 2024
@ChristophWurst ChristophWurst merged commit 50fffa8 into master Feb 2, 2024
@ChristophWurst ChristophWurst deleted the fix-issue-42464 branch February 2, 2024 11:29
@furai
Copy link

furai commented Feb 2, 2024

Isn't this line improperly formatted?

@blizzz blizzz mentioned this pull request Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

4. to release Ready to be released and/or waiting for tests to finish bug feature: caldav Related to CalDAV internals feature: status

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: NC28 CalDAV Exceptions when opening Calendar app

5 participants