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:
parent
ca2ca8553a
commit
b7459c9ded
1 changed files with 4 additions and 0 deletions
|
@ -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())
|
||||||
|
|
Loading…
Reference in a new issue