Skip to content

Commit

Permalink
Fixed crash when navigating to folder without read permissions (fixes #…
Browse files Browse the repository at this point in the history
  • Loading branch information
Nutomic committed Mar 17, 2015
1 parent ca2ca85 commit b7459c9
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,10 @@ private void displayFolder(File folder) {
mLocation = folder;
mFilesAdapter.clear();
File[] contents = mLocation.listFiles();
// In case we don't have read access to the folder, just display nothing.
if (contents == null)
contents = new File[]{};

Arrays.sort(contents, new Comparator<File>() {
public int compare(File f1, File f2) {
if (f1.isDirectory() && f2.isFile())
Expand Down

0 comments on commit b7459c9

Please sign in to comment.