Fixed crash when navigating to folder without read permissions (fixes #244).
This commit is contained in:
parent
ca2ca8553a
commit
b7459c9ded
@ -179,6 +179,10 @@ public class FolderPickerActivity extends SyncthingActivity
|
||||
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())
|
||||
|
||||
Loading…
Reference in New Issue
Block a user