diff --git a/packages/trpc/server/routers/loggedInViewer/setDestinationCalendar.handler.ts b/packages/trpc/server/routers/loggedInViewer/setDestinationCalendar.handler.ts index 344f456b99..9f7e42bf4c 100644 --- a/packages/trpc/server/routers/loggedInViewer/setDestinationCalendar.handler.ts +++ b/packages/trpc/server/routers/loggedInViewer/setDestinationCalendar.handler.ts @@ -81,7 +81,8 @@ export const setDestinationCalendarHandler = async ({ ctx, input }: SetDestinati allCals.find( (cal) => cal.primary && - (cal.credentialId === credentialId || cal.delegationCredentialId === delegationCredentialId) + (cal.credentialId === credentialId || + (!!cal.delegationCredentialId && cal.delegationCredentialId === delegationCredentialId)) )?.email ?? null; if (eventTypeId) {