diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/github/daneren2005/dsub/fragments/SubsonicFragment.java | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/github/daneren2005/dsub/fragments/SubsonicFragment.java b/src/github/daneren2005/dsub/fragments/SubsonicFragment.java index d4b222b2..fcba86a2 100644 --- a/src/github/daneren2005/dsub/fragments/SubsonicFragment.java +++ b/src/github/daneren2005/dsub/fragments/SubsonicFragment.java @@ -625,10 +625,14 @@ public class SubsonicFragment extends Fragment implements SwipeRefreshLayout.OnR Util.toast(context, R.string.select_album_no_sdcard);
}
- StatFs stat = new StatFs(FileUtil.getMusicDirectory(context).getPath());
- long bytesAvailableFs = (long) stat.getAvailableBlocks() * (long) stat.getBlockSize();
- if(bytesAvailableFs < 50000000L) {
- Util.toast(context, context.getResources().getString(R.string.select_album_no_room, Util.formatBytes(bytesAvailableFs)));
+ try {
+ StatFs stat = new StatFs(FileUtil.getMusicDirectory(context).getPath());
+ long bytesAvailableFs = (long) stat.getAvailableBlocks() * (long) stat.getBlockSize();
+ if (bytesAvailableFs < 50000000L) {
+ Util.toast(context, context.getResources().getString(R.string.select_album_no_room, Util.formatBytes(bytesAvailableFs)));
+ }
+ } catch(Exception e) {
+ Log.w(TAG, "Error while checking storage space for music directory", e);
}
}
|