Merge pull request #447 from FineFindus/fix/crash

fix(StatusDisplayItem): check if headerlist is empty
This commit is contained in:
LucasGGamerM
2024-07-06 11:45:10 -03:00
committed by GitHub

View File

@@ -779,10 +779,12 @@ public abstract class BaseStatusListFragment<T extends DisplayItemsParent> exten
if(s.textExpandable!=expandable && list!=null) { if(s.textExpandable!=expandable && list!=null) {
s.textExpandable=expandable; s.textExpandable=expandable;
List<HeaderStatusDisplayItem.Holder> headers=findAllHoldersOfType(holder.getItemID(), HeaderStatusDisplayItem.Holder.class); List<HeaderStatusDisplayItem.Holder> headers=findAllHoldersOfType(holder.getItemID(), HeaderStatusDisplayItem.Holder.class);
if(headers!=null && !headers.isEmpty()){
HeaderStatusDisplayItem.Holder header=headers.size() > 1 && isForQuote ? headers.get(1) : headers.get(0); HeaderStatusDisplayItem.Holder header=headers.size() > 1 && isForQuote ? headers.get(1) : headers.get(0);
if(header!=null) header.bindCollapseButton(); if(header!=null) header.bindCollapseButton();
} }
} }
}
public void onToggleExpanded(Status status, boolean isForQuote, String itemID) { public void onToggleExpanded(Status status, boolean isForQuote, String itemID) {
status.textExpanded = !status.textExpanded; status.textExpanded = !status.textExpanded;