fix with object undefined check (#9493)

pull/9500/head
Syed Ali Shahbaz 2023-06-14 01:57:42 +05:30 committed by GitHub
parent e081a4cfc2
commit f0992b4914
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -337,7 +337,7 @@ export default abstract class BaseCalendarService implements Calendar {
const userTimeZone = userId ? await this.getUserTimezoneFromDB(userId) : "Europe/London";
const events: { start: string; end: string }[] = [];
objects.forEach((object) => {
if (object.data == null || JSON.stringify(object.data) == "{}") return;
if (!object || object.data == null || JSON.stringify(object.data) == "{}") return;
let vcalendar: ICAL.Component;
try {
const jcalData = ICAL.parse(sanitizeCalendarObject(object));