From 0ceed56f998c0fdb796088d82345051a205b66ce Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Tue, 11 Jan 2022 11:06:43 -0600 Subject: [PATCH] LoginPage: fix crash --- app/soapbox/features/auth_login/components/login_page.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/soapbox/features/auth_login/components/login_page.js b/app/soapbox/features/auth_login/components/login_page.js index 096b3f50e..ca16c2a81 100644 --- a/app/soapbox/features/auth_login/components/login_page.js +++ b/app/soapbox/features/auth_login/components/login_page.js @@ -52,8 +52,9 @@ class LoginPage extends ImmutablePureComponent { dispatch(switchAccount(account.id)); } }).catch(error => { - if (error.response.data.error === 'mfa_required') { - this.setState({ mfa_auth_needed: true, mfa_token: error.response.data.mfa_token }); + const data = error.response && error.response.data; + if (data && data.error === 'mfa_required') { + this.setState({ mfa_auth_needed: true, mfa_token: data.mfa_token }); } this.setState({ isLoading: false }); });