Prevent crash

pull/199/head
M66B 4 years ago
parent e6e7236059
commit 539874aded

@ -506,7 +506,9 @@ public class FragmentDialogOpenLink extends FragmentDialogBase {
if (host != null) { if (host != null) {
int textColorLink = Helper.resolveColor(context, android.R.attr.textColorLink); int textColorLink = Helper.resolveColor(context, android.R.attr.textColorLink);
int index = text.indexOf(host); int index = text.indexOf(host);
ssb.setSpan(new ForegroundColorSpan(textColorLink), index, index + host.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); if (index >= 0)
ssb.setSpan(new ForegroundColorSpan(textColorLink),
index, index + host.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
} }
return ssb; return ssb;
} }

Loading…
Cancel
Save