[FIX] Register crashing when error data is undefined (#2256)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
This commit is contained in:
parent
7d2f4afaae
commit
77917f66f0
|
@ -145,11 +145,13 @@ 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 });
|
||||
}
|
||||
if (e.data?.error) {
|
||||
showErrorAlert(e.data.error, I18n.t('Oops'));
|
||||
}
|
||||
}
|
||||
this.setState({ saving: false });
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue