1
0
Fork 0
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:
Felix Ableitner 2014-10-09 00:17:07 +03:00
parent fe295009ca
commit 12f7b3dbe2
2 changed files with 4 additions and 1 deletions

View file

@ -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;

View file

@ -88,7 +88,9 @@ public class FolderObserver extends FileObserver {
case MOVED_TO: case MOVED_TO:
// fall through // fall through
case CREATE: case CREATE:
if (new File(mPath, path).isDirectory()) {
mChilds.add(new FolderObserver(mListener, mFolder, path)); 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());