From 8356e2374486b34c3f5c1c09ca84b678461f52a7 Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Mon, 9 May 2022 15:31:59 +0100 Subject: [PATCH] improve --- src/app/services/events.service.ts | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/app/services/events.service.ts b/src/app/services/events.service.ts index 3d355a5a9..f2cc203fd 100644 --- a/src/app/services/events.service.ts +++ b/src/app/services/events.service.ts @@ -247,15 +247,20 @@ export class EventsService { } for (let sharedCalendar of this.loggeduser.SharedCalendars) { - this.GetCalendarName(sharedCalendar.OwnerUserId).subscribe((e)=> { - this.calendarNames[sharedCalendar.CalendarId] = e.FullName - }) + if(sharedCalendar?.OwnerUserId) { + this.GetCalendarName(sharedCalendar.OwnerUserId).subscribe((e)=> { + this.calendarNames[sharedCalendar.CalendarId] = e.FullName + }) + } + } for (let sharedCalendar of this.loggeduser.OwnerCalendars) { - this.GetCalendarName(sharedCalendar.OwnerUserId).subscribe((e)=> { - this.calendarNames[sharedCalendar.CalendarId] = e.FullName - }) + if(sharedCalendar?.OwnerUserId) { + this.GetCalendarName(sharedCalendar.OwnerUserId).subscribe((e)=> { + this.calendarNames[sharedCalendar.CalendarId] = e.FullName + }) + } } } }