Prevent crash

This commit is contained in:
M66B 2018-12-27 18:01:20 +00:00
parent 862cb0e8cc
commit ecff88269b
1 changed files with 1 additions and 1 deletions

View File

@ -528,7 +528,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
SpannableStringBuilder ssb = new SpannableStringBuilder(message.headers); SpannableStringBuilder ssb = new SpannableStringBuilder(message.headers);
int index = 0; int index = 0;
for (String line : message.headers.split("\n")) { for (String line : message.headers.split("\n")) {
if (!Character.isWhitespace(line.charAt(0))) { if (line.length() > 0 && !Character.isWhitespace(line.charAt(0))) {
int colon = line.indexOf(':'); int colon = line.indexOf(':');
if (colon > 0) if (colon > 0)
ssb.setSpan(new StyleSpan(Typeface.BOLD), index, index + colon, 0); ssb.setSpan(new StyleSpan(Typeface.BOLD), index, index + colon, 0);