Prevent crash

This commit is contained in:
M66B 2019-04-26 09:10:40 +02:00
parent 8f7d13fd0d
commit 91910d6403
1 changed files with 4 additions and 0 deletions

View File

@ -255,6 +255,10 @@ public class AdapterAccount extends RecyclerView.Adapter<AdapterAccount.ViewHold
}
void onMove(int from, int to) {
if (from < 0 || from >= items.size() ||
to < 0 || to >= items.size())
return;
if (from < to)
for (int i = from; i < to; i++)
Collections.swap(items, i, i + 1);