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 String mPath;
|
||||||
|
|
||||||
private final ArrayList<FolderObserver> mChilds;
|
private final ArrayList<FolderObserver> mChilds = new ArrayList<>();
|
||||||
|
|
||||||
public interface OnFolderFileChangeListener {
|
public interface OnFolderFileChangeListener {
|
||||||
public void onFolderFileChange(String folderId, String relativePath);
|
public void onFolderFileChange(String folderId, String relativePath);
|
||||||
|
@ -74,9 +74,10 @@ public class FolderObserver extends FileObserver {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
mChilds = new ArrayList<>();
|
if (directories != null) {
|
||||||
for (File f : directories) {
|
for (File f : directories) {
|
||||||
mChilds.add(new FolderObserver(mListener, mFolder, path + "/" + f.getName()));
|
mChilds.add(new FolderObserver(mListener, mFolder, path + "/" + f.getName()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue