diff --git a/packages/server/src/sdk/app/views/index.ts b/packages/server/src/sdk/app/views/index.ts index a1cffeb2b5..60f886c2e2 100644 --- a/packages/server/src/sdk/app/views/index.ts +++ b/packages/server/src/sdk/app/views/index.ts @@ -35,8 +35,16 @@ export async function findByTable(tableId: string): Promise { export async function get(viewId: string): Promise { const db = context.getAppDB() - const result = await db.get(viewId) - return result + try { + const result = await db.get(viewId) + return result + } catch (err: any) { + if (err.status === 404) { + return undefined + } + + throw err + } } export async function save(view: ViewV2): Promise {