fix(StatusDisplayItem/Quote): only update non-empty adapter
Fixes a crash when updating an empty adapter. This was the case when opening a status from a notification.
This commit is contained in:
@@ -722,8 +722,10 @@ public abstract class BaseStatusListFragment<T extends DisplayItemsParent> exten
|
||||
assert this instanceof StatusListFragment;
|
||||
List<StatusDisplayItem> items=((StatusListFragment) this).buildDisplayItems(status);
|
||||
displayItems.subList(startIndex, endIndex+1).clear();
|
||||
boolean isEmpty=displayItems.isEmpty();
|
||||
displayItems.addAll(startIndex, items);
|
||||
adapter.notifyItemRangeChanged(startIndex, items.size());
|
||||
if(!isEmpty)
|
||||
adapter.notifyItemRangeChanged(startIndex, items.size());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user