From f46d288b1b87069b795a7274c729d3903f16aa6c Mon Sep 17 00:00:00 2001 From: EYHN Date: Tue, 1 Jul 2025 11:38:13 +0800 Subject: [PATCH] fix(core): fix client crash (#12966) ## Summary by CodeRabbit * **Bug Fixes** * Improved reliability when displaying OAuth provider icons by handling cases where the provider may not be recognized, preventing potential errors during authentication. --- packages/frontend/core/src/components/affine/auth/oauth.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/frontend/core/src/components/affine/auth/oauth.tsx b/packages/frontend/core/src/components/affine/auth/oauth.tsx index 0334439ba9..6fda9696e3 100644 --- a/packages/frontend/core/src/components/affine/auth/oauth.tsx +++ b/packages/frontend/core/src/components/affine/auth/oauth.tsx @@ -110,7 +110,10 @@ interface OauthProviderProps { } function OAuthProvider({ onContinue, provider }: OauthProviderProps) { - const { icon } = OAuthProviderMap[provider]; + const { icon } = + provider in OAuthProviderMap + ? OAuthProviderMap[provider] + : { icon: undefined }; const onClick = useCallback(() => { onContinue(provider);