aboutsummaryrefslogtreecommitdiff
path: root/subsonic-android
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2012-12-03 21:19:23 -0800
committerScott Jackson <daneren2005@gmail.com>2012-12-03 21:19:23 -0800
commitd9ef20bd455ed49e1fa64079bc0609e473fee908 (patch)
treef9fb54f774c8b8e72b0c3006c9d77e7e3f122c92 /subsonic-android
parentdc3ab40ef2f9e227a932f873e675514ce3c420f2 (diff)
downloaddsub-d9ef20bd455ed49e1fa64079bc0609e473fee908.tar.gz
dsub-d9ef20bd455ed49e1fa64079bc0609e473fee908.tar.bz2
dsub-d9ef20bd455ed49e1fa64079bc0609e473fee908.zip
Added safety check for timerDuration int conversion
Diffstat (limited to 'subsonic-android')
-rw-r--r--subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceImpl.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceImpl.java b/subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceImpl.java
index ba6bff04..a1c81cb4 100644
--- a/subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceImpl.java
+++ b/subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceImpl.java
@@ -174,7 +174,11 @@ public class DownloadServiceImpl extends Service implements DownloadService {
wakeLock.setReferenceCounted(false);
SharedPreferences prefs = Util.getPreferences(this);
- timerDuration = Integer.parseInt(prefs.getString(Constants.PREFERENCES_KEY_SLEEP_TIMER_DURATION, "60"));
+ try {
+ timerDuration = Integer.parseInt(prefs.getString(Constants.PREFERENCES_KEY_SLEEP_TIMER_DURATION, "5"));
+ } catch(Exception e) {
+ timerDuration = 5;
+ }
sleepTimer = null;
keepScreenOn = prefs.getBoolean(Constants.PREFERENCES_KEY_KEEP_SCREEN_ON, false);