diff options
author | Daniel Gultsch <daniel@gultsch.de> | 2015-10-02 11:58:03 +0200 |
---|---|---|
committer | Daniel Gultsch <daniel@gultsch.de> | 2015-10-02 11:58:03 +0200 |
commit | 160dfa49a09340ad23c38a02eb7c936aab92eba2 (patch) | |
tree | c6edcf4e39db102c54f3348047ec54abf41f67c9 /src/main/java/eu | |
parent | 9bb868304824e9e61fa997b282bf1cd4ceac12ec (diff) |
try to catch plattform bugs
Diffstat (limited to 'src/main/java/eu')
-rw-r--r-- | src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java b/src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java index 7733edc7..a31adf18 100644 --- a/src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java +++ b/src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java @@ -274,7 +274,12 @@ public class MessageAdapter extends ArrayAdapter<Message> { viewHolder.messageBody.setIncludeFontPadding(true); if (message.getBody() != null) { final String nick = UIHelper.getMessageDisplayName(message); - final String body = message.getMergedBody().replaceAll("^" + Message.ME_COMMAND,nick + " "); + String body; + try { + body = message.getMergedBody().replaceAll("^" + Message.ME_COMMAND, nick + " "); + } catch (ArrayIndexOutOfBoundsException e) { + body = message.getMergedBody(); + } final SpannableString formattedBody = new SpannableString(body); int i = body.indexOf(Message.MERGE_SEPARATOR); while(i >= 0) { |