From 1843233168c3ac95f1bc9489b50da301a25268ec Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Fri, 19 Jul 2024 11:18:09 +0200 Subject: [PATCH] Undefined context checks --- packages/server/src/sdk/app/rowActions.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/server/src/sdk/app/rowActions.ts b/packages/server/src/sdk/app/rowActions.ts index dfb6975c48..6a6e5670f4 100644 --- a/packages/server/src/sdk/app/rowActions.ts +++ b/packages/server/src/sdk/app/rowActions.ts @@ -49,9 +49,14 @@ export async function create(tableId: string, rowAction: { name: string }) { ensureUniqueAndThrow(doc, action.name) + const appId = context.getAppId() + if (!appId) { + throw new Error("Could not get the current appId") + } + const automation = await automations.create({ name: `${tableName}: ${action.name}`, - appId: context.getAppId()!, + appId, definition: { trigger: { type: AutomationStepType.TRIGGER,