aboutsummaryrefslogtreecommitdiff
path: root/subsonic-android
diff options
context:
space:
mode:
authordaneren2005 <daneren2005@gmail.com>2013-03-27 11:20:59 -0700
committerdaneren2005 <daneren2005@gmail.com>2013-03-27 11:20:59 -0700
commit9eb0980395358ef2a6a75eef046fd5ea0b78843b (patch)
tree98c4b0ecfc8862d22bfdbaed45698f6c0b2a5362 /subsonic-android
parent957028375c384e5d74e4b13b2fde54377397683a (diff)
downloaddsub-9eb0980395358ef2a6a75eef046fd5ea0b78843b.tar.gz
dsub-9eb0980395358ef2a6a75eef046fd5ea0b78843b.tar.bz2
dsub-9eb0980395358ef2a6a75eef046fd5ea0b78843b.zip
Fix crash if playlistView.getAdapter is null
Diffstat (limited to 'subsonic-android')
-rw-r--r--subsonic-android/src/github/daneren2005/dsub/activity/DownloadActivity.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/subsonic-android/src/github/daneren2005/dsub/activity/DownloadActivity.java b/subsonic-android/src/github/daneren2005/dsub/activity/DownloadActivity.java
index 735bf98f..d93d0817 100644
--- a/subsonic-android/src/github/daneren2005/dsub/activity/DownloadActivity.java
+++ b/subsonic-android/src/github/daneren2005/dsub/activity/DownloadActivity.java
@@ -489,18 +489,18 @@ public class DownloadActivity extends SubsonicTabActivity implements OnGestureLi
// Scroll to current playing/downloading.
private void scrollToCurrent() {
- if (getDownloadService() == null) {
+ if (getDownloadService() == null || songListAdapter == null) {
return;
}
- for (int i = 0; i < playlistView.getAdapter().getCount(); i++) {
+ for (int i = 0; i < songListAdapter.getCount(); i++) {
if (currentPlaying == playlistView.getItemAtPosition(i)) {
playlistView.setSelectionFromTop(i, 40);
return;
}
}
DownloadFile currentDownloading = getDownloadService().getCurrentDownloading();
- for (int i = 0; i < playlistView.getAdapter().getCount(); i++) {
+ for (int i = 0; i < songListAdapter.getCount(); i++) {
if (currentDownloading == playlistView.getItemAtPosition(i)) {
playlistView.setSelectionFromTop(i, 40);
return;