From 9b4e12e3bc27076bd120ae4f641091d44de5ebc9 Mon Sep 17 00:00:00 2001 From: hailin Date: Tue, 20 May 2025 23:24:01 +0800 Subject: [PATCH] . --- chatdesk-ui/app/[locale]/login/page.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/chatdesk-ui/app/[locale]/login/page.tsx b/chatdesk-ui/app/[locale]/login/page.tsx index 844adba..70206ca 100644 --- a/chatdesk-ui/app/[locale]/login/page.tsx +++ b/chatdesk-ui/app/[locale]/login/page.tsx @@ -121,7 +121,12 @@ export default async function Login({ const workspace = homeWorkspace[0]; // Use the first (and only) row if (!homeWorkspace || homeWorkspace.length === 0) { - throw new Error((homeWorkspaceError as Error)?.message || "No home workspace found for this user."); + if (homeWorkspaceError) { + // If homeWorkspaceError is not null, access its message + throw new Error(homeWorkspaceError.message); + } + // Fallback message if homeWorkspaceError is null + throw new Error("No home workspace found for this user."); } // if (!homeWorkspace) {