@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix NULL pointer exception in some circumstances from Calendar's homepage

Summary:
After importing specific weird events, for example from Google Calendar (bleah), it can happen that the Calendar's homepage becomes broken.

This was the Exception error shown to video:

"Call to a member function getEventsBetween() on null"

It was happening since this method can return NULL:

PhabricatorCalendarEventQuery#newRecurrenceSet()

This changeset verifies this condition from the Calendar's homepage.

Closes T15136

Test Plan: I tried in my server. I've executed the syntax lint. On my local machine I was not able to run "arc diff" since it tries to connect to root@localhost for some reasons.

Reviewers: O1 Blessed Committers, 20after4

Reviewed By: O1 Blessed Committers, 20after4

Subscribers: 0, Cigaryno, 20after4, speck, tobiaswiese, Matthew

Tags: #calendar

Maniphest Tasks: T15136

Differential Revision: https://we.phorge.it/D25060

authored by

Valerio Bozzolan and committed by
Matthew Bowker
dc558b55 a8a38835

+8 -4
+8 -4
src/applications/calendar/query/PhabricatorCalendarEventQuery.php
··· 222 222 223 223 $limit = $this->getRecurrenceLimit($event, $raw_limit); 224 224 225 + // note that this can be NULL for some imported events 225 226 $set = $event->newRecurrenceSet(); 226 227 227 - $recurrences = $set->getEventsBetween( 228 - $start_date, 229 - $end_date, 230 - $limit + 1); 228 + $recurrences = array(); 229 + if ($set) { 230 + $recurrences = $set->getEventsBetween( 231 + $start_date, 232 + $end_date, 233 + $limit + 1); 234 + } 231 235 232 236 // We're generating events from the beginning and then filtering them 233 237 // here (instead of only generating events starting at the start date)