fix(search): crash on akkoma where hashtag histories arent present

This commit is contained in:
LucasGGamerM 2023-04-29 16:53:58 -03:00
parent 9d09a904ab
commit 42ae74f1a7
1 changed files with 7 additions and 6 deletions

View File

@ -37,12 +37,13 @@ public class HashtagStatusDisplayItem extends StatusDisplayItem{
public void onBind(HashtagStatusDisplayItem _item){ public void onBind(HashtagStatusDisplayItem _item){
Hashtag item=_item.tag; Hashtag item=_item.tag;
title.setText('#'+item.name); title.setText('#'+item.name);
int numPeople=item.history.get(0).accounts; if(item.history != null){
if(item.history.size()>1) int numPeople=item.history.get(0).accounts;
numPeople+=item.history.get(1).accounts; if(item.history.size()>1)
subtitle.setText(_item.parentFragment.getResources().getQuantityString(R.plurals.x_people_talking, numPeople, numPeople)); numPeople+=item.history.get(1).accounts;
chart.setData(item.history); subtitle.setText(_item.parentFragment.getResources().getQuantityString(R.plurals.x_people_talking, numPeople, numPeople));
chart.setData(item.history);
}
} }
} }
} }