diff --git a/CHANGELOG.md b/CHANGELOG.md index b4f6c408..a3352add 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,6 +36,7 @@ _This release is scheduled to be released on 2021-01-01._ - Fix calendar when no DTEND record found in event, startDate overlay when endDate set (#2177) - Fix console.debug not having timestamps (#2199) - Fix calendar full day event east of UTC start time (#2200) +- Catch errors when parsing calendar data with ical (#2022) - Corrected logic for timeFormat "relative" and "absolute" ## [2.13.0] - 2020-10-01 diff --git a/modules/default/calendar/calendarfetcher.js b/modules/default/calendar/calendarfetcher.js index 758224a9..c5c8901d 100644 --- a/modules/default/calendar/calendarfetcher.js +++ b/modules/default/calendar/calendarfetcher.js @@ -76,7 +76,16 @@ const CalendarFetcher = function (url, reloadInterval, excludedEvents, maximumEn return; } - const data = ical.parseICS(requestData); + let data = []; + + try { + data = ical.parseICS(requestData); + } catch (error) { + fetchFailedCallback(self, error.message); + scheduleTimer(); + return; + } + const newEvents = []; // limitFunction doesn't do much limiting, see comment re: the dates array in rrule section below as to why we need to do the filtering ourselves