Added fail safe

pull/215/head
M66B 7 months ago
parent bc5f8f2e1f
commit b70e9fd085

@ -2572,14 +2572,18 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
} }
Matcher m = Helper.EMAIL_ADDRESS.matcher(personal); Matcher m = Helper.EMAIL_ADDRESS.matcher(personal);
while (m.find()) { while (m.find())
String e = personal.substring(m.start(), m.end()); try {
if (!e.equalsIgnoreCase(email)) { String e = personal.substring(m.start(), m.end());
int start = ssb.length() - personal.length(); if (!e.equalsIgnoreCase(email)) {
ssb.setSpan(new StyleSpan(Typeface.BOLD), start + m.start(), start + m.end(), 0); int start = ssb.length() - personal.length();
ssb.setSpan(new ForegroundColorSpan(colorError), start + m.start(), start + m.end(), 0); ssb.setSpan(new StyleSpan(Typeface.BOLD), start + m.start(), start + m.end(), 0);
ssb.setSpan(new ForegroundColorSpan(colorError), start + m.start(), start + m.end(), 0);
}
} catch (Throwable ex) {
Log.e(ex);
break;
} }
}
if (full) { if (full) {
ssb.append(" <"); ssb.append(" <");

Loading…
Cancel
Save