diff --git a/packages/backend/src/server/api/call.ts b/packages/backend/src/server/api/call.ts index 5bc7d2f25e..ea9ab3ccba 100644 --- a/packages/backend/src/server/api/call.ts +++ b/packages/backend/src/server/api/call.ts @@ -90,7 +90,7 @@ export default async (endpoint: string, user: User | null | undefined, token: Ac // API invoking const before = performance.now(); - return await ep.exec(data, user, token, ctx!.file).catch((e: Error) => { + return await ep.exec(data, user, token, ctx?.file).catch((e: Error) => { if (e instanceof ApiError) { throw e; } else {