diff options
author | Martin Fietz <martin.fietz@gmail.com> | 2017-10-19 21:53:21 +0200 |
---|---|---|
committer | Martin Fietz <martin.fietz@gmail.com> | 2017-10-19 21:53:21 +0200 |
commit | a98ed53625362af76ca7e2a375d4d34f32efcdcf (patch) | |
tree | d86484891c2f38147598a7ece81ef3e912f75aec /app/src | |
parent | 3a150ac42871ba69ed5fb0b735103bb9d4258706 (diff) | |
download | AntennaPod-a98ed53625362af76ca7e2a375d4d34f32efcdcf.zip |
Prevent ArrayIndexOutOfBoundsException
Diffstat (limited to 'app/src')
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/fragment/QueueFragment.java | 3 |
1 files changed, 3 insertions, 0 deletions
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); |