diff --git a/src/androidTest/java/com/nutomic/syncthingandroid/test/util/FolderObserverTest.java b/src/androidTest/java/com/nutomic/syncthingandroid/test/util/FolderObserverTest.java index 28b7911e..4af77ca4 100644 --- a/src/androidTest/java/com/nutomic/syncthingandroid/test/util/FolderObserverTest.java +++ b/src/androidTest/java/com/nutomic/syncthingandroid/test/util/FolderObserverTest.java @@ -2,6 +2,7 @@ package com.nutomic.syncthingandroid.test.util; import android.test.AndroidTestCase; import android.test.suitebuilder.annotation.MediumTest; +import android.test.suitebuilder.annotation.SmallTest; import com.nutomic.syncthingandroid.syncthing.RestApi; import com.nutomic.syncthingandroid.test.MockContext; diff --git a/src/main/java/com/nutomic/syncthingandroid/util/FolderObserver.java b/src/main/java/com/nutomic/syncthingandroid/util/FolderObserver.java index 048fa987..38eef138 100644 --- a/src/main/java/com/nutomic/syncthingandroid/util/FolderObserver.java +++ b/src/main/java/com/nutomic/syncthingandroid/util/FolderObserver.java @@ -88,7 +88,9 @@ public class FolderObserver extends FileObserver { case MOVED_TO: // fall through case CREATE: - mChilds.add(new FolderObserver(mListener, mFolder, path)); + if (new File(mPath, path).isDirectory()) { + mChilds.add(new FolderObserver(mListener, mFolder, path)); + } // fall through default: mListener.onFolderFileChange(mFolder.ID, new File(mPath, path).getPath());