mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-09-21 03:41:42 +02:00
[Android] Fix crash when we don't have access to a folder.
This commit is contained in:
parent
bd713643d1
commit
07434e3a65
1 changed files with 17 additions and 12 deletions
|
@ -159,7 +159,13 @@ public final class FileAdapter extends RecyclerView.Adapter<FileViewHolder> impl
|
|||
private ArrayList<FileListItem> generateFileList(File directory)
|
||||
{
|
||||
File[] children = directory.listFiles();
|
||||
ArrayList<FileListItem> fileList = new ArrayList<FileListItem>(children.length);
|
||||
mPath = directory.getAbsolutePath();
|
||||
ArrayList<FileListItem> fileList = new ArrayList<FileListItem>(0);
|
||||
|
||||
if (children != null)
|
||||
{
|
||||
|
||||
fileList = new ArrayList<FileListItem>(children.length);
|
||||
|
||||
for (File child : children)
|
||||
{
|
||||
|
@ -170,9 +176,8 @@ public final class FileAdapter extends RecyclerView.Adapter<FileViewHolder> impl
|
|||
}
|
||||
}
|
||||
|
||||
mPath = directory.getAbsolutePath();
|
||||
|
||||
Collections.sort(fileList);
|
||||
}
|
||||
return fileList;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue