aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2018-05-03 21:54:24 +0200
committerChristian Schneppe <christian@pix-art.de>2018-05-03 21:54:24 +0200
commit4ffaf3016f17a35a217b079bb680cd11c2fbc13e (patch)
tree6d3cee3550397a73f48b5036e9e0b42cc2f8ce82 /src
parenta6a1f89124c09d325a4570025df974b35158ebda (diff)
added null check to Jid.of in edit account
Diffstat (limited to '')
-rw-r--r--src/main/java/de/pixart/messenger/ui/EditAccountActivity.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java b/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java
index 407a967a7..573e7078f 100644
--- a/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java
+++ b/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java
@@ -162,7 +162,7 @@ public class EditAccountActivity extends OmemoActivity implements OnAccountUpdat
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url.toString())));
return;
} catch (ActivityNotFoundException e) {
- Toast.makeText(EditAccountActivity.this, R.string.application_found_to_open_website, Toast.LENGTH_SHORT);
+ Toast.makeText(EditAccountActivity.this, R.string.application_found_to_open_website, Toast.LENGTH_SHORT).show();
return;
}
}
@@ -174,7 +174,7 @@ public class EditAccountActivity extends OmemoActivity implements OnAccountUpdat
} else {
jid = Jid.of(binding.accountJid.getText().toString());
}
- } catch (final IllegalArgumentException e) {
+ } catch (final NullPointerException | IllegalArgumentException e) {
if (mUsernameMode) {
mAccountJidLayout.setError(getString(R.string.invalid_username));
} else {
@@ -783,7 +783,7 @@ public class EditAccountActivity extends OmemoActivity implements OnAccountUpdat
}
private String getUserModeDomain() {
- if (mAccount != null) {
+ if (mAccount != null && mAccount.getJid().getDomain() != null) {
return mAccount.getJid().getDomain();
} else {
return Config.DOMAIN_LOCK;