diff options
author | Eugene Sandulenko | 2019-09-26 18:08:44 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2019-09-27 00:22:20 +0200 |
commit | 0481669b1f89f026786fb689169be9ff1f7b1466 (patch) | |
tree | cbcb52f49d6a50fd6ee503f176318cbc00194c51 /backends/platform/android | |
parent | f12d7160f840eaa2607002cf0be2e3e8c1b17941 (diff) | |
download | scummvm-rg350-0481669b1f89f026786fb689169be9ff1f7b1466.tar.gz scummvm-rg350-0481669b1f89f026786fb689169be9ff1f7b1466.tar.bz2 scummvm-rg350-0481669b1f89f026786fb689169be9ff1f7b1466.zip |
ANDROID: Fix exception
Diffstat (limited to 'backends/platform/android')
-rw-r--r-- | backends/platform/android/org/scummvm/scummvm/ExternalStorage.java | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/backends/platform/android/org/scummvm/scummvm/ExternalStorage.java b/backends/platform/android/org/scummvm/scummvm/ExternalStorage.java index acfd2393a4..b9e7bf0cd1 100644 --- a/backends/platform/android/org/scummvm/scummvm/ExternalStorage.java +++ b/backends/platform/android/org/scummvm/scummvm/ExternalStorage.java @@ -54,7 +54,7 @@ public class ExternalStorage { try { File mountFile = new File("/proc/mounts"); - if (mountFile.exists()){ + if (mountFile.exists()) { Scanner scanner = new Scanner(mountFile); while (scanner.hasNext()) { String line = scanner.nextLine(); @@ -154,12 +154,14 @@ public class ExternalStorage { File externalStorageRoot = new File(externalStorageRootDir); File[] files = externalStorageRoot.listFiles(); - for (final File file : files) { - if (file.isDirectory() && file.canRead() && (file.listFiles().length > 0)) { // it is a real directory (not a USB drive)... - String key = file.getAbsolutePath(); - if (!map.contains(key)) { - map.add(key); // Make name as directory - map.add(key); + if (files.length > 0) { + for (final File file : files) { + if (file.isDirectory() && file.canRead() && (file.listFiles().length > 0)) { // it is a real directory (not a USB drive)... + String key = file.getAbsolutePath(); + if (!map.contains(key)) { + map.add(key); // Make name as directory + map.add(key); + } } } } |