diff options
author | daneren2005 <daneren2005@gmail.com> | 2013-03-27 11:20:59 -0700 |
---|---|---|
committer | daneren2005 <daneren2005@gmail.com> | 2013-03-27 11:20:59 -0700 |
commit | 9eb0980395358ef2a6a75eef046fd5ea0b78843b (patch) | |
tree | 98c4b0ecfc8862d22bfdbaed45698f6c0b2a5362 /subsonic-android/src/github | |
parent | 957028375c384e5d74e4b13b2fde54377397683a (diff) | |
download | dsub-9eb0980395358ef2a6a75eef046fd5ea0b78843b.tar.gz dsub-9eb0980395358ef2a6a75eef046fd5ea0b78843b.tar.bz2 dsub-9eb0980395358ef2a6a75eef046fd5ea0b78843b.zip |
Fix crash if playlistView.getAdapter is null
Diffstat (limited to 'subsonic-android/src/github')
-rw-r--r-- | subsonic-android/src/github/daneren2005/dsub/activity/DownloadActivity.java | 6 |
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; |