aboutsummaryrefslogtreecommitdiff
path: root/subsonic-android/src
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2013-06-22 11:01:29 -0700
committerScott Jackson <daneren2005@gmail.com>2013-06-22 11:01:29 -0700
commit6ea08dcbcc5bc2611ed48f4c2e542f6cf25e60d1 (patch)
treec0a9eb64dbc40e79df977968740ec8919c082583 /subsonic-android/src
parentfb06f7357048d654ccc70282c12368f86378f7fd (diff)
downloaddsub-6ea08dcbcc5bc2611ed48f4c2e542f6cf25e60d1.tar.gz
dsub-6ea08dcbcc5bc2611ed48f4c2e542f6cf25e60d1.tar.bz2
dsub-6ea08dcbcc5bc2611ed48f4c2e542f6cf25e60d1.zip
Surround operation with try, catch
Diffstat (limited to 'subsonic-android/src')
-rw-r--r--subsonic-android/src/github/daneren2005/dsub/activity/SettingsActivity.java10
1 files changed, 7 insertions, 3 deletions
diff --git a/subsonic-android/src/github/daneren2005/dsub/activity/SettingsActivity.java b/subsonic-android/src/github/daneren2005/dsub/activity/SettingsActivity.java
index dbb25c65..9b74987d 100644
--- a/subsonic-android/src/github/daneren2005/dsub/activity/SettingsActivity.java
+++ b/subsonic-android/src/github/daneren2005/dsub/activity/SettingsActivity.java
@@ -331,9 +331,13 @@ public class SettingsActivity extends PreferenceActivity implements SharedPrefer
private void setHideMedia(boolean hide) {
File nomediaDir = new File(FileUtil.getSubsonicDirectory(), ".nomedia");
if (hide && !nomediaDir.exists()) {
- if (!nomediaDir.createNewFile()) {
- Log.w(TAG, "Failed to create " + nomediaDir);
- }
+ try {
+ if (!nomediaDir.createNewFile()) {
+ Log.w(TAG, "Failed to create " + nomediaDir);
+ }
+ } catch(Exception e) {
+ Log.w(TAG, "Failed to create " + nomediaDir);
+ }
} else if (nomediaDir.exists()) {
if (!nomediaDir.delete()) {
Log.w(TAG, "Failed to delete " + nomediaDir);