From 74b06a499736a4b7573537a58d72767cdd19eef3 Mon Sep 17 00:00:00 2001 From: LucasGGamerM Date: Fri, 19 May 2023 11:04:39 -0300 Subject: [PATCH] fix: crash when account.note field is null This sometimes happens on calckey. And this fixes the crash --- .../org/joinmastodon/android/fragments/ProfileFragment.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/ProfileFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/ProfileFragment.java index 3a3e20800..0468c5b03 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/ProfileFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/ProfileFragment.java @@ -624,7 +624,10 @@ public class ProfileFragment extends LoaderFragment implements OnBackPressedList // noinspection SetTextI18n username.setText('@'+account.acct+(isSelf ? ('@'+AccountSessionManager.getInstance().getAccount(accountID).domain) : "")); } - CharSequence parsedBio=HtmlParser.parse(account.note, account.emojis, Collections.emptyList(), Collections.emptyList(), accountID); + CharSequence parsedBio = null; + if(account.note != null){ + parsedBio=HtmlParser.parse(account.note, account.emojis, Collections.emptyList(), Collections.emptyList(), accountID); + } if(TextUtils.isEmpty(parsedBio)){ bio.setVisibility(View.GONE); }else{