aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2015-10-02 11:58:03 +0200
committerDaniel Gultsch <daniel@gultsch.de>2015-10-02 11:58:03 +0200
commit160dfa49a09340ad23c38a02eb7c936aab92eba2 (patch)
treec6edcf4e39db102c54f3348047ec54abf41f67c9
parent9bb868304824e9e61fa997b282bf1cd4ceac12ec (diff)
try to catch plattform bugs1.6.11
-rw-r--r--src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java7
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) {