From d1098d8bfb635b231085d019cfd2349be264bbf9 Mon Sep 17 00:00:00 2001 From: Christian Schneppe Date: Wed, 21 Nov 2018 20:17:43 +0100 Subject: fix crash with xmpp uris --- src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/main/java') diff --git a/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java b/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java index 8ba2587b5..42a0bc81b 100644 --- a/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java +++ b/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java @@ -413,7 +413,12 @@ public class MessageAdapter extends ArrayAdapter implements CopyTextVie private void displayXmppMessage(final ViewHolder viewHolder, final String body) { String contact = body.toLowerCase(); contact = contact.split(":")[1]; - boolean group = (contact.split("\\?")[1]) != null && (contact.split("\\?")[1]).length() > 0 && (contact.split("\\?")[1]).equalsIgnoreCase("join"); + boolean group; + try { + group = ((contact.split("\\?")[1]) != null && (contact.split("\\?")[1]).length() > 0 && (contact.split("\\?")[1]).equalsIgnoreCase("join")); + } catch (Exception e) { + group = false; + } contact = contact.split("\\?")[0]; String add_contact = activity.getString(R.string.add_to_contact_list) + " (" + contact + ")"; viewHolder.audioPlayer.setVisibility(View.GONE); -- cgit v1.2.3