mirror of
https://github.com/syncthing/syncthing-android.git
synced 2025-01-09 19:53:33 +00:00
Fixed crash in FolderObserver if folder can't be accessed (fixes #180).
This commit is contained in:
parent
ade88b3f95
commit
fa3898f8f4
1 changed files with 5 additions and 4 deletions
|
@ -22,7 +22,7 @@ public class FolderObserver extends FileObserver {
|
|||
|
||||
private final String mPath;
|
||||
|
||||
private final ArrayList<FolderObserver> mChilds;
|
||||
private final ArrayList<FolderObserver> mChilds = new ArrayList<>();
|
||||
|
||||
public interface OnFolderFileChangeListener {
|
||||
public void onFolderFileChange(String folderId, String relativePath);
|
||||
|
@ -74,11 +74,12 @@ public class FolderObserver extends FileObserver {
|
|||
}
|
||||
});
|
||||
|
||||
mChilds = new ArrayList<>();
|
||||
if (directories != null) {
|
||||
for (File f : directories) {
|
||||
mChilds.add(new FolderObserver(mListener, mFolder, path + "/" + f.getName()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles incoming events for changed files.
|
||||
|
|
Loading…
Reference in a new issue