diff --git a/app/views/RegisterView.js b/app/views/RegisterView.js index 1fe127416..1e0ce2654 100644 --- a/app/views/RegisterView.js +++ b/app/views/RegisterView.js @@ -145,10 +145,12 @@ class RegisterView extends React.Component { await loginRequest({ user: email, password }); } } catch (e) { - if (e.data && e.data.errorType === 'username-invalid') { + if (e.data?.errorType === 'username-invalid') { return loginRequest({ user: email, password }); } - showErrorAlert(e.data.error, I18n.t('Oops')); + if (e.data?.error) { + showErrorAlert(e.data.error, I18n.t('Oops')); + } } this.setState({ saving: false }); }