From fb0d155e3afc1da881f3cb79a29d1eed23cd3ac3 Mon Sep 17 00:00:00 2001 From: Christian Schneppe Date: Tue, 28 Aug 2018 21:04:00 +0200 Subject: catch NPE on inviteUser --- src/main/java/de/pixart/messenger/ui/XmppActivity.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/de/pixart/messenger/ui/XmppActivity.java b/src/main/java/de/pixart/messenger/ui/XmppActivity.java index f52b2d72c..3ab6bfc6a 100644 --- a/src/main/java/de/pixart/messenger/ui/XmppActivity.java +++ b/src/main/java/de/pixart/messenger/ui/XmppActivity.java @@ -943,7 +943,11 @@ public abstract class XmppActivity extends ActionBarActivity { } public void inviteUser() { - if (xmppConnectionServiceBound && !xmppConnectionService.multipleAccounts()) { + if (!xmppConnectionServiceBound) { + Toast.makeText(this, R.string.not_connected_try_again, Toast.LENGTH_SHORT).show(); + return; + } + if (!xmppConnectionService.multipleAccounts()) { Account mAccount = xmppConnectionService.getAccounts().get(0); String user = Jid.of(mAccount.getJid()).getLocal(); String domain = Jid.of(mAccount.getJid()).getDomain(); -- cgit v1.2.3