aboutsummaryrefslogtreecommitdiff
path: root/subsonic-android
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2013-01-25 07:22:06 -0800
committerScott Jackson <daneren2005@gmail.com>2013-01-25 07:22:06 -0800
commita01ecfb0b4901e54e0901d7ac1a880d20185ce27 (patch)
tree7762c3eddc754dc4cee38539ef88bb992fe76115 /subsonic-android
parent4854b7fee57895d3ab1e79032dc21f5a87ed1f85 (diff)
downloaddsub-a01ecfb0b4901e54e0901d7ac1a880d20185ce27.tar.gz
dsub-a01ecfb0b4901e54e0901d7ac1a880d20185ce27.tar.bz2
dsub-a01ecfb0b4901e54e0901d7ac1a880d20185ce27.zip
Do a null check on shuffle params
Diffstat (limited to 'subsonic-android')
-rw-r--r--subsonic-android/src/github/daneren2005/dsub/util/ShufflePlayBuffer.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/subsonic-android/src/github/daneren2005/dsub/util/ShufflePlayBuffer.java b/subsonic-android/src/github/daneren2005/dsub/util/ShufflePlayBuffer.java
index 51d86f74..56a710ea 100644
--- a/subsonic-android/src/github/daneren2005/dsub/util/ShufflePlayBuffer.java
+++ b/subsonic-android/src/github/daneren2005/dsub/util/ShufflePlayBuffer.java
@@ -108,9 +108,11 @@ public class ShufflePlayBuffer {
private void clearBufferIfnecessary() {
synchronized (buffer) {
final SharedPreferences prefs = Util.getPreferences(context);
- if (currentServer != Util.getActiveServer(context) || !currentFolder.equals(Util.getSelectedMusicFolderId(context))
- || !genre.equals(prefs.getString(Constants.PREFERENCES_KEY_SHUFFLE_GENRE, "")) || !startYear.equals(prefs.getString(Constants.PREFERENCES_KEY_SHUFFLE_START_YEAR, ""))
- || !endYear.equals(prefs.getString(Constants.PREFERENCES_KEY_SHUFFLE_END_YEAR, ""))) {
+ if (currentServer != Util.getActiveServer(context)
+ || (currentFolder != null && !currentFolder.equals(Util.getSelectedMusicFolderId(context)))
+ || (genre != null && !genre.equals(prefs.getString(Constants.PREFERENCES_KEY_SHUFFLE_GENRE, "")))
+ || (startYear != null && !startYear.equals(prefs.getString(Constants.PREFERENCES_KEY_SHUFFLE_START_YEAR, "")))
+ || (endYear != null && !endYear.equals(prefs.getString(Constants.PREFERENCES_KEY_SHUFFLE_END_YEAR, "")))) {
currentServer = Util.getActiveServer(context);
currentFolder = Util.getSelectedMusicFolderId(context);
genre = prefs.getString(Constants.PREFERENCES_KEY_SHUFFLE_GENRE, "");