From 15e5ffb60386a600726ec5e8ba679a96cebaf1c6 Mon Sep 17 00:00:00 2001 From: hailin Date: Tue, 20 May 2025 23:25:55 +0800 Subject: [PATCH] . --- chatdesk-ui/app/[locale]/login/page.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/chatdesk-ui/app/[locale]/login/page.tsx b/chatdesk-ui/app/[locale]/login/page.tsx index 70206ca..b7ae77a 100644 --- a/chatdesk-ui/app/[locale]/login/page.tsx +++ b/chatdesk-ui/app/[locale]/login/page.tsx @@ -121,11 +121,10 @@ export default async function Login({ const workspace = homeWorkspace[0]; // Use the first (and only) row if (!homeWorkspace || homeWorkspace.length === 0) { + // Assert that homeWorkspaceError is of type PostgrestError or similar if (homeWorkspaceError) { - // If homeWorkspaceError is not null, access its message - throw new Error(homeWorkspaceError.message); + throw new Error((homeWorkspaceError as PostgrestError).message || "No home workspace found for this user."); } - // Fallback message if homeWorkspaceError is null throw new Error("No home workspace found for this user."); }