Skip to content

Commit

Permalink
Be more defensive when re-ordering grid items.
Browse files Browse the repository at this point in the history
  • Loading branch information
nickbutcher committed Nov 19, 2015
1 parent 883a029 commit ce7ea8f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/src/main/java/io/plaidapp/ui/FeedAdapter.java
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,9 @@ private void expandPopularItems() {
int rowPosition = (pos + extraSpannedSpaces) % columns;
if (rowPosition != 0) {
int swapWith = pos + (columns - rowPosition);
Collections.swap(items, pos, swapWith);
if (swapWith < items.size()) {
Collections.swap(items, pos, swapWith);
}
}
}
}
Expand Down

0 comments on commit ce7ea8f

Please sign in to comment.