diff --git a/packages/app-store/_utils/getCalendar.ts b/packages/app-store/_utils/getCalendar.ts index 6c1c5d5c..15ad3067 100644 --- a/packages/app-store/_utils/getCalendar.ts +++ b/packages/app-store/_utils/getCalendar.ts @@ -11,7 +11,7 @@ export const getCalendar = (credential: Credential | null): Calendar | null => { if (!credential) return null; const { type: calendarType } = credential; const calendarApp = appStore[calendarType.split("_").join("") as keyof typeof appStore]; - if (!calendarApp || !("lib" in calendarApp && "CalendarService" in calendarApp.lib)) { + if (!(calendarApp && "lib" in calendarApp && "CalendarService" in calendarApp.lib)) { log.warn(`calendar of type ${calendarType} does not implemented`); return null; } diff --git a/packages/core/videoClient.ts b/packages/core/videoClient.ts index dcc4de29..fb26e69f 100644 --- a/packages/core/videoClient.ts +++ b/packages/core/videoClient.ts @@ -18,7 +18,7 @@ const getVideoAdapters = (withCredentials: Credential[]): VideoApiAdapter[] => withCredentials.reduce((acc, cred) => { const appName = cred.type.split("_").join(""); // Transform `zoom_video` to `zoomvideo`; const app = appStore[appName as keyof typeof appStore]; - if ("lib" in app && "VideoApiAdapter" in app.lib) { + if (app && "lib" in app && "VideoApiAdapter" in app.lib) { const makeVideoApiAdapter = app.lib.VideoApiAdapter as VideoApiAdapterFactory; const videoAdapter = makeVideoApiAdapter(cred); acc.push(videoAdapter);