From 6af7aefe00566de02e2c254d8df3389ff2074c5f Mon Sep 17 00:00:00 2001 From: LongYinan Date: Tue, 5 Sep 2023 12:21:28 -0700 Subject: [PATCH] fix(core): location.state maybe null (#4203) --- apps/core/src/pages/sign-in.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/core/src/pages/sign-in.tsx b/apps/core/src/pages/sign-in.tsx index 91cf56513a..d59223101b 100644 --- a/apps/core/src/pages/sign-in.tsx +++ b/apps/core/src/pages/sign-in.tsx @@ -29,14 +29,16 @@ export const Component = () => { await onceSignedIn(); setAuthAtom(prev => ({ ...prev, onceSignedIn: undefined })); } - if (location.state.callbackURL) { + if (location.state?.callbackURL) { navigate(location.state.callbackURL, { replace: true, }); } } }; - afterSignedIn(); + afterSignedIn().catch(err => { + console.error(err); + }); }, [ location.state.callbackURL, loginStatus,