aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoriNPUTmice <daniel@gultsch.de>2014-12-03 10:52:55 +0100
committeriNPUTmice <daniel@gultsch.de>2014-12-03 10:52:55 +0100
commit685f405154bcc014053d3f22664fc25ca32db8ab (patch)
tree0fe1578dc869db03626c7e69c9914753e0362e77
parent8f62d95e1fb5980daab5294148106ce09237e386 (diff)
display proper error in edit account details if jid is invalid
-rw-r--r--src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java b/src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java
index 22507483b..8fad66cf9 100644
--- a/src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java
+++ b/src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java
@@ -74,14 +74,15 @@ public class EditAccountActivity extends XmppActivity implements OnAccountUpdate
return;
}
boolean registerNewAccount = mRegisterNew.isChecked();
- final Jid jid;
- try {
- jid = Jid.fromString(mAccountJid.getText().toString());
- } catch (final InvalidJidException e) {
- // TODO: Handle this error?
- return;
- }
- String password = mPassword.getText().toString();
+ final Jid jid;
+ try {
+ jid = Jid.fromString(mAccountJid.getText().toString());
+ } catch (final InvalidJidException e) {
+ mAccountJid.setError(getString(R.string.invalid_jid));
+ mAccountJid.requestFocus();
+ return;
+ }
+ String password = mPassword.getText().toString();
String passwordConfirm = mPasswordConfirm.getText().toString();
if (registerNewAccount) {
if (!password.equals(passwordConfirm)) {