fix with object undefined check (#9493)

This commit is contained in:
Syed Ali Shahbaz authored and GitHub committed 2023-06-13 20:27:42 +00:00
1 parent e081a4cfc2
commit f0992b4914
1 file changed
+1 -1
+1 -1
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));