Merge pull request #2210 from rejas/issue-2022_catch-ical-parsing-errors

Catch errors when parsing calendar data with ical
This commit is contained in:
Michael Teeuw 2020-12-08 15:13:42 +01:00 committed by GitHub
commit 667be460e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 1 deletions

View File

@ -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 calendar when no DTEND record found in event, startDate overlay when endDate set (#2177)
- Fix console.debug not having timestamps (#2199) - Fix console.debug not having timestamps (#2199)
- Fix calendar full day event east of UTC start time (#2200) - 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" - Corrected logic for timeFormat "relative" and "absolute"
## [2.13.0] - 2020-10-01 ## [2.13.0] - 2020-10-01

View File

@ -76,7 +76,16 @@ const CalendarFetcher = function (url, reloadInterval, excludedEvents, maximumEn
return; return;
} }
const data = ical.parseICS(requestData); let data = [];
try {
data = ical.parseICS(requestData);
} catch (error) {
fetchFailedCallback(self, error.message);
scheduleTimer();
return;
}
const newEvents = []; 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 // 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