From 28c64c2bd10263fc4370d3edf80a465dad46cd5a Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Fri, 23 Dec 2016 21:19:11 +0100 Subject: skip empty lines in message preview. prevents indexoutofbounds exception --- src/main/java/eu/siacs/conversations/utils/UIHelper.java | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/main/java/eu/siacs') diff --git a/src/main/java/eu/siacs/conversations/utils/UIHelper.java b/src/main/java/eu/siacs/conversations/utils/UIHelper.java index ebb800d4..ae40fc08 100644 --- a/src/main/java/eu/siacs/conversations/utils/UIHelper.java +++ b/src/main/java/eu/siacs/conversations/utils/UIHelper.java @@ -201,6 +201,9 @@ public class UIHelper { char first = l.charAt(0); if (first != '>' && first != '\u00bb') { String line = l.trim(); + if (line.isEmpty()) { + continue; + } char last = line.charAt(line.length()-1); if (builder.length() != 0) { builder.append(' '); -- cgit v1.2.3