diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/adapters/FileAdapter.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/adapters/FileAdapter.java index 8d07b6c101..aea9ce7297 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/adapters/FileAdapter.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/adapters/FileAdapter.java @@ -159,20 +159,25 @@ public final class FileAdapter extends RecyclerView.Adapter impl private ArrayList generateFileList(File directory) { File[] children = directory.listFiles(); - ArrayList fileList = new ArrayList(children.length); - - for (File child : children) - { - if (!child.isHidden()) - { - FileListItem item = new FileListItem(child); - fileList.add(item); - } - } - mPath = directory.getAbsolutePath(); + ArrayList fileList = new ArrayList(0); - Collections.sort(fileList); + if (children != null) + { + + fileList = new ArrayList(children.length); + + for (File child : children) + { + if (!child.isHidden()) + { + FileListItem item = new FileListItem(child); + fileList.add(item); + } + } + + Collections.sort(fileList); + } return fileList; }