diff --git a/app/src/main/java/github/daneren2005/dsub/util/FileUtil.java b/app/src/main/java/github/daneren2005/dsub/util/FileUtil.java index 2495db17e..04dc73b75 100644 --- a/app/src/main/java/github/daneren2005/dsub/util/FileUtil.java +++ b/app/src/main/java/github/daneren2005/dsub/util/FileUtil.java @@ -484,8 +484,12 @@ private static File getBestDir(File[] dirs) { // Past 5.0 we can query directly for SD Card if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { for(int i = 0; i < dirs.length; i++) { - if(dirs[i] != null && Environment.isExternalStorageRemovable(dirs[i])) { - return dirs[i]; + try { + if (dirs[i] != null && Environment.isExternalStorageRemovable(dirs[i])) { + return dirs[i]; + } + } catch (Exception e) { + Log.e(TAG, "Failed to check if is external", e); } } }