diff options
author | Scott Jackson <daneren2005@gmail.com> | 2012-12-10 20:05:30 -0800 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2012-12-10 20:05:30 -0800 |
commit | b068e03bc48796c80862e332e2433cd3f8f09d62 (patch) | |
tree | 032f5fac96eaa98d7df730d122a83cc34edfd9f8 /subsonic-android/src/github | |
parent | 880da5f0f9bded724e45c95b7393703a813a05f7 (diff) | |
download | dsub-b068e03bc48796c80862e332e2433cd3f8f09d62.tar.gz dsub-b068e03bc48796c80862e332e2433cd3f8f09d62.tar.bz2 dsub-b068e03bc48796c80862e332e2433cd3f8f09d62.zip |
Fix Music Services sometimes returning null Indexes
Diffstat (limited to 'subsonic-android/src/github')
-rw-r--r-- | subsonic-android/src/github/daneren2005/dsub/service/RESTMusicService.java | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/subsonic-android/src/github/daneren2005/dsub/service/RESTMusicService.java b/subsonic-android/src/github/daneren2005/dsub/service/RESTMusicService.java index 75ec6142..f9a6af99 100644 --- a/subsonic-android/src/github/daneren2005/dsub/service/RESTMusicService.java +++ b/subsonic-android/src/github/daneren2005/dsub/service/RESTMusicService.java @@ -70,17 +70,8 @@ import android.net.ConnectivityManager; import android.net.NetworkInfo; import android.util.Log; import github.daneren2005.dsub.R; -import github.daneren2005.dsub.domain.Indexes; -import github.daneren2005.dsub.domain.JukeboxStatus; -import github.daneren2005.dsub.domain.Lyrics; -import github.daneren2005.dsub.domain.MusicDirectory; +import github.daneren2005.dsub.domain.*; import github.daneren2005.dsub.domain.MusicDirectory.Entry; -import github.daneren2005.dsub.domain.MusicFolder; -import github.daneren2005.dsub.domain.Playlist; -import github.daneren2005.dsub.domain.SearchCritera; -import github.daneren2005.dsub.domain.SearchResult; -import github.daneren2005.dsub.domain.ServerInfo; -import github.daneren2005.dsub.domain.Version; import github.daneren2005.dsub.service.parser.AlbumListParser; import github.daneren2005.dsub.service.parser.ErrorParser; import github.daneren2005.dsub.service.parser.IndexesParser; @@ -234,7 +225,11 @@ public class RESTMusicService implements MusicService { writeCachedIndexes(context, indexes, musicFolderId); return indexes; } - return cachedIndexes; + if(cachedIndexes != null) { + return cachedIndexes; + } else { + return new Indexes(0, new ArrayList<Artist>(), new ArrayList<Artist>()); + } } finally { Util.close(reader); } |