mirror of
https://github.com/syncthing/syncthing-android.git
synced 2024-12-23 19:31:30 +00:00
Fixed crash when receiving file move or create event (fixes #144).
This commit is contained in:
parent
fe295009ca
commit
12f7b3dbe2
2 changed files with 4 additions and 1 deletions
|
@ -2,6 +2,7 @@ package com.nutomic.syncthingandroid.test.util;
|
||||||
|
|
||||||
import android.test.AndroidTestCase;
|
import android.test.AndroidTestCase;
|
||||||
import android.test.suitebuilder.annotation.MediumTest;
|
import android.test.suitebuilder.annotation.MediumTest;
|
||||||
|
import android.test.suitebuilder.annotation.SmallTest;
|
||||||
|
|
||||||
import com.nutomic.syncthingandroid.syncthing.RestApi;
|
import com.nutomic.syncthingandroid.syncthing.RestApi;
|
||||||
import com.nutomic.syncthingandroid.test.MockContext;
|
import com.nutomic.syncthingandroid.test.MockContext;
|
||||||
|
|
|
@ -88,7 +88,9 @@ public class FolderObserver extends FileObserver {
|
||||||
case MOVED_TO:
|
case MOVED_TO:
|
||||||
// fall through
|
// fall through
|
||||||
case CREATE:
|
case CREATE:
|
||||||
mChilds.add(new FolderObserver(mListener, mFolder, path));
|
if (new File(mPath, path).isDirectory()) {
|
||||||
|
mChilds.add(new FolderObserver(mListener, mFolder, path));
|
||||||
|
}
|
||||||
// fall through
|
// fall through
|
||||||
default:
|
default:
|
||||||
mListener.onFolderFileChange(mFolder.ID, new File(mPath, path).getPath());
|
mListener.onFolderFileChange(mFolder.ID, new File(mPath, path).getPath());
|
||||||
|
|
Loading…
Reference in a new issue