fix: fix crash on calckey on profile reload

Adds null check in account avatar/header load function
This commit is contained in:
LucasGGamerM 2023-05-15 19:54:13 -03:00
parent ac2e7cde41
commit c3b5bb409b
1 changed files with 6 additions and 2 deletions

View File

@ -566,8 +566,12 @@ public class ProfileFragment extends LoaderFragment implements OnBackPressedList
private void bindHeaderView(){
setTitle(account.displayName);
setSubtitle(getResources().getQuantityString(R.plurals.x_posts, (int)(account.statusesCount%1000), account.statusesCount));
if((GlobalUserPreferences.playGifs ? account.avatar : account.avatarStatic) != null){
ViewImageLoader.load(avatar, null, new UrlImageLoaderRequest(GlobalUserPreferences.playGifs ? account.avatar : account.avatarStatic, V.dp(100), V.dp(100)));
}
if((GlobalUserPreferences.playGifs ? account.header : account.headerStatic) != null) {
ViewImageLoader.load(cover, null, new UrlImageLoaderRequest(GlobalUserPreferences.playGifs ? account.header : account.headerStatic, 1000, 1000));
}
SpannableStringBuilder ssb=new SpannableStringBuilder(account.displayName);
HtmlParser.parseCustomEmoji(ssb, account.emojis);
name.setText(ssb);