From 685f405154bcc014053d3f22664fc25ca32db8ab Mon Sep 17 00:00:00 2001 From: iNPUTmice Date: Wed, 3 Dec 2014 10:52:55 +0100 Subject: [PATCH] display proper error in edit account details if jid is invalid --- .../conversations/ui/EditAccountActivity.java | 17 +++++++++-------- 1 file 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)) {