diff --git a/app/src/main/java/app/fedilab/android/helper/SpannableHelper.java b/app/src/main/java/app/fedilab/android/helper/SpannableHelper.java index dd977e77..73d99369 100644 --- a/app/src/main/java/app/fedilab/android/helper/SpannableHelper.java +++ b/app/src/main/java/app/fedilab/android/helper/SpannableHelper.java @@ -184,8 +184,8 @@ public class SpannableHelper { if (matchEnd > content.toString().length()) { matchEnd = content.toString().length(); } - if (content.toString().length() > matchEnd) { - matchEnd = content.toString().length(); + if (content.toString().length() > matchEnd || matchStart < 0) { + continue; } final String url = content.toString().substring(matchStart, matchEnd); String newURL = Helper.transformURL(context, url);