Skip to content

Commit

Permalink
fix(toggle-expanded): fix crash when headers happen to be empty
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasGGamerM committed Aug 3, 2024
1 parent c45128c commit 0388f9d
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -815,6 +815,8 @@ public void onToggleExpanded(Status status, boolean isForQuote, String itemID) {
adapter.notifyItemChanged(text.getAbsoluteAdapterPosition());
}
List<HeaderStatusDisplayItem.Holder> headers=findAllHoldersOfType(itemID, HeaderStatusDisplayItem.Holder.class);
if (headers.isEmpty())
return;
HeaderStatusDisplayItem.Holder header=headers.size() > 1 && isForQuote ? headers.get(1) : headers.get(0);
if(header!=null) header.animateExpandToggle();
else notifyItemChanged(itemID, HeaderStatusDisplayItem.class);
Expand Down

0 comments on commit 0388f9d

Please sign in to comment.