Skip to content
This repository was archived by the owner on Dec 1, 2017. It is now read-only.

Commit 5cdfa72

Browse files
committed
[core] Guard against state.getItemCount() being < 0
This seems like a bug in RecyclerView but can happen if the adapter is changed multiple times between layouts.
1 parent 756ba8a commit 5cdfa72

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/src/main/java/org/lucasr/twowayview/TwoWayLayoutManager.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ private void fillAfter(int position, Recycler recycler, State state, int extraSp
273273
}
274274

275275
private void fillSpecific(int position, Recycler recycler, State state) {
276-
if (state.getItemCount() == 0) {
276+
if (state.getItemCount() <= 0) {
277277
return;
278278
}
279279

0 commit comments

Comments
 (0)