aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/github/daneren2005/dsub/fragments/SubsonicFragment.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/github/daneren2005/dsub/fragments/SubsonicFragment.java b/src/github/daneren2005/dsub/fragments/SubsonicFragment.java
index 9e5d936b..4fa7019b 100644
--- a/src/github/daneren2005/dsub/fragments/SubsonicFragment.java
+++ b/src/github/daneren2005/dsub/fragments/SubsonicFragment.java
@@ -1443,7 +1443,8 @@ public class SubsonicFragment extends Fragment implements SwipeRefreshLayout.OnR
}
}
protected void playNow(List<Entry> entries, int position) {
- playNow(entries, entries.get(0), position);
+ Entry selected = entries.isEmpty() ? null : entries.get(0);
+ playNow(entries, selected, position);
}
protected void playNow(List<Entry> entries, Entry song, int position) {
DownloadService downloadService = getDownloadService();
@@ -1452,7 +1453,9 @@ public class SubsonicFragment extends Fragment implements SwipeRefreshLayout.OnR
}
downloadService.clear();
- downloadService.download(entries, false, true, true, false, entries.indexOf(song), position);
+ if(song != null) {
+ downloadService.download(entries, false, true, true, false, entries.indexOf(song), position);
+ }
Util.startActivityWithoutTransition(context, DownloadActivity.class);
}
@@ -1472,7 +1475,7 @@ public class SubsonicFragment extends Fragment implements SwipeRefreshLayout.OnR
@Override
protected void done(Void result) {
- if(adapter != null) {
+ if (adapter != null) {
adapter.remove(entry);
adapter.notifyDataSetChanged();
}