1
0
Fork 0
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:
Felix Ableitner 2014-11-05 19:11:34 +02:00
parent ade88b3f95
commit fa3898f8f4

View file

@ -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,9 +74,10 @@ public class FolderObserver extends FileObserver {
}
});
mChilds = new ArrayList<>();
for (File f : directories) {
mChilds.add(new FolderObserver(mListener, mFolder, path + "/" + f.getName()));
if (directories != null) {
for (File f : directories) {
mChilds.add(new FolderObserver(mListener, mFolder, path + "/" + f.getName()));
}
}
}