summaryrefslogtreecommitdiff
path: root/app/src/main/java
diff options
context:
space:
mode:
authorByteHamster <info@bytehamster.com>2021-03-06 21:50:34 +0100
committerByteHamster <info@bytehamster.com>2021-03-07 10:15:09 +0100
commit0d21dbed4cc253dda1499779485aca4bd34b9c15 (patch)
tree2de37fe39c9df0f77c6a66993f5567a902c048d1 /app/src/main/java
parentf9baf6812b413b1a0f7b4fa869a4bc0176a819b7 (diff)
downloadAntennaPod-0d21dbed4cc253dda1499779485aca4bd34b9c15.zip
Fixed 2 little bugs related to queue movement
- moving while downloading sometimes caused ArrayIndexOutOfBoundsException - Long-pressing and then swiping out leaves the screen empty and the context menu open. Pressing items crashed the app.
Diffstat (limited to 'app/src/main/java')
-rw-r--r--app/src/main/java/de/danoeh/antennapod/fragment/QueueFragment.java4
1 files changed, 2 insertions, 2 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 2850acc15..b92043c7d 100644
--- a/app/src/main/java/de/danoeh/antennapod/fragment/QueueFragment.java
+++ b/app/src/main/java/de/danoeh/antennapod/fragment/QueueFragment.java
@@ -385,7 +385,7 @@ public class QueueFragment extends Fragment implements Toolbar.OnMenuItemClickLi
@Override
public boolean onContextItemSelected(MenuItem item) {
Log.d(TAG, "onContextItemSelected() called with: " + "item = [" + item + "]");
- if(!isVisible()) {
+ if (!isVisible() || recyclerAdapter == null) {
return false;
}
FeedItem selectedItem = recyclerAdapter.getSelectedItem();
@@ -464,7 +464,7 @@ public class QueueFragment extends Fragment implements Toolbar.OnMenuItemClickLi
int from = viewHolder.getAdapterPosition();
int to = target.getAdapterPosition();
Log.d(TAG, "move(" + from + ", " + to + ") in memory");
- if (from >= queue.size() || to >= queue.size()) {
+ if (from >= queue.size() || to >= queue.size() || from < 0 || to < 0) {
return false;
}
queue.add(to, queue.remove(from));