diff options
author | Scott Jackson <daneren2005@gmail.com> | 2012-12-03 21:19:23 -0800 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2012-12-03 21:19:23 -0800 |
commit | d9ef20bd455ed49e1fa64079bc0609e473fee908 (patch) | |
tree | f9fb54f774c8b8e72b0c3006c9d77e7e3f122c92 /subsonic-android | |
parent | dc3ab40ef2f9e227a932f873e675514ce3c420f2 (diff) | |
download | dsub-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.java | 6 |
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); |