diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/QueueFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/QueueFragment.java index d7f25c134..fccb86076 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/QueueFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/QueueFragment.java @@ -400,6 +400,9 @@ public class QueueFragment extends Fragment { int from = viewHolder.getAdapterPosition(); int to = target.getAdapterPosition(); Log.d(TAG, "move(" + from + ", " + to + ")"); + if(from >= queue.size() || to >= queue.size()) { + return false; + } queue.add(to, queue.remove(from)); recyclerAdapter.notifyItemMoved(from, to); DBWriter.moveQueueItem(from, to, true);