From d7976734ce46a15e35f964e867d8449771d47855 Mon Sep 17 00:00:00 2001 From: Thomas Date: Thu, 15 Dec 2022 10:46:31 +0100 Subject: [PATCH] Fix issue #636 - Freeze with the app. --- .../main/java/app/fedilab/android/helper/SpannableHelper.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 0d5b7bf38..03e9a52c5 100644 --- a/app/src/main/java/app/fedilab/android/helper/SpannableHelper.java +++ b/app/src/main/java/app/fedilab/android/helper/SpannableHelper.java @@ -494,7 +494,9 @@ public class SpannableHelper { contentUrl = new SpannableString(Html.fromHtml(value, Html.FROM_HTML_MODE_LEGACY)); else contentUrl = new SpannableString(Html.fromHtml(value)); - + if (contentUrl.toString().trim().isEmpty()) { + continue; + } Pattern word = Pattern.compile(Pattern.quote(contentUrl.toString())); Matcher matcherLink = word.matcher(content); while (matcherLink.find()) {