1
0
Fork 0
mirror of https://github.com/syncthing/syncthing-android.git synced 2024-12-23 03:11:30 +00:00

Fixed crash when navigating to folder without read permissions (fixes #244).

This commit is contained in:
Felix Ableitner 2015-03-17 01:03:32 +01:00
parent ca2ca8553a
commit b7459c9ded

View file

@ -179,6 +179,10 @@ public class FolderPickerActivity extends SyncthingActivity
mLocation = folder; mLocation = folder;
mFilesAdapter.clear(); mFilesAdapter.clear();
File[] contents = mLocation.listFiles(); 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>() { Arrays.sort(contents, new Comparator<File>() {
public int compare(File f1, File f2) { public int compare(File f1, File f2) {
if (f1.isDirectory() && f2.isFile()) if (f1.isDirectory() && f2.isFile())