[FIX] Register crashing when error data is undefined (#2256)
Co-authored-by: Diego Mello <diegolmello@gmail.com>
This commit is contained in:
parent
ef68f1644a
commit
ea10693c40
|
@ -145,10 +145,12 @@ class RegisterView extends React.Component {
|
||||||
await loginRequest({ user: email, password });
|
await loginRequest({ user: email, password });
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (e.data && e.data.errorType === 'username-invalid') {
|
if (e.data?.errorType === 'username-invalid') {
|
||||||
return loginRequest({ user: email, password });
|
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 });
|
this.setState({ saving: false });
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue