diff options
author | Scott Jackson <daneren2005@gmail.com> | 2013-06-22 11:01:29 -0700 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2013-06-22 11:01:29 -0700 |
commit | 6ea08dcbcc5bc2611ed48f4c2e542f6cf25e60d1 (patch) | |
tree | c0a9eb64dbc40e79df977968740ec8919c082583 | |
parent | fb06f7357048d654ccc70282c12368f86378f7fd (diff) | |
download | dsub-6ea08dcbcc5bc2611ed48f4c2e542f6cf25e60d1.tar.gz dsub-6ea08dcbcc5bc2611ed48f4c2e542f6cf25e60d1.tar.bz2 dsub-6ea08dcbcc5bc2611ed48f4c2e542f6cf25e60d1.zip |
Surround operation with try, catch
-rw-r--r-- | subsonic-android/src/github/daneren2005/dsub/activity/SettingsActivity.java | 10 |
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); |