From 42ae74f1a7dc3b392a4c36428194fd13b152a28c Mon Sep 17 00:00:00 2001 From: LucasGGamerM Date: Sat, 29 Apr 2023 16:53:58 -0300 Subject: [PATCH] fix(search): crash on akkoma where hashtag histories arent present --- .../ui/displayitems/HashtagStatusDisplayItem.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/HashtagStatusDisplayItem.java b/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/HashtagStatusDisplayItem.java index cc2f3d2b8..d44a5be86 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/HashtagStatusDisplayItem.java +++ b/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/HashtagStatusDisplayItem.java @@ -37,12 +37,13 @@ public class HashtagStatusDisplayItem extends StatusDisplayItem{ public void onBind(HashtagStatusDisplayItem _item){ Hashtag item=_item.tag; title.setText('#'+item.name); - int numPeople=item.history.get(0).accounts; - if(item.history.size()>1) - numPeople+=item.history.get(1).accounts; - subtitle.setText(_item.parentFragment.getResources().getQuantityString(R.plurals.x_people_talking, numPeople, numPeople)); - chart.setData(item.history); - + if(item.history != null){ + int numPeople=item.history.get(0).accounts; + if(item.history.size()>1) + numPeople+=item.history.get(1).accounts; + subtitle.setText(_item.parentFragment.getResources().getQuantityString(R.plurals.x_people_talking, numPeople, numPeople)); + chart.setData(item.history); + } } } }