fix: fix crash on TrendingHashtagsFragment when Hashtah history is null

This is the same fix applied for akkoma instances in 42ae74f1a7
It also applies for calckey instances
This commit is contained in:
LucasGGamerM 2023-05-14 09:24:49 -03:00
parent 84ae1aad56
commit 889fff5103
1 changed files with 7 additions and 4 deletions

View File

@ -117,11 +117,14 @@ public class TrendingHashtagsFragment extends BaseRecyclerFragment<Hashtag> impl
@Override
public void onBind(Hashtag item){
title.setText('#'+item.name);
int numPeople=item.history.get(0).accounts;
if(item.history.size()>1)
numPeople+=item.history.get(1).accounts;
int numPeople = 0;
if(item.history != null){
numPeople=item.history.get(0).accounts;
if(item.history.size()>1)
numPeople+=item.history.get(1).accounts;
chart.setData(item.history);
}
subtitle.setText(getResources().getQuantityString(R.plurals.x_people_talking, numPeople, numPeople));
chart.setData(item.history);
}
@Override