aboutsummaryrefslogtreecommitdiff
path: root/backends/platform/android
diff options
context:
space:
mode:
authorEugene Sandulenko2019-09-26 18:08:44 +0200
committerEugene Sandulenko2019-09-27 00:22:20 +0200
commit0481669b1f89f026786fb689169be9ff1f7b1466 (patch)
treecbcb52f49d6a50fd6ee503f176318cbc00194c51 /backends/platform/android
parentf12d7160f840eaa2607002cf0be2e3e8c1b17941 (diff)
downloadscummvm-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.java16
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);
+ }
}
}
}