Skip to content

Commit 6deaaf6

Browse files
author
Plamen Petkov
committed
Merge branch 'plamen5kov/livesync_delete_files_fix' into release
2 parents cda45df + 11c3c39 commit 6deaaf6

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/src/com/tns/NativeScriptSyncService.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ public void run()
145145
int length = input.readInt();
146146
input.readFully(new byte[length]); //ignore the payload
147147
executePartialSync(context, syncDir);
148+
executeRemovedSync(context, removedSyncDir);
148149

149150
Platform.runScript(new File(NativeScriptSyncService.this.context.getFilesDir(), "internal/livesync.js"));
150151

@@ -321,8 +322,15 @@ private void executePartialSync(Context context, File sourceDir)
321322

322323
private void deleteRemovedFiles(File sourceDir, String sourceRootAbsolutePath, String targetRootAbsolutePath)
323324
{
325+
if(!sourceDir.exists()) {
326+
if (logger.isEnabled())
327+
{
328+
logger.write("Directory does not exist: " + sourceDir.getAbsolutePath());
329+
}
330+
}
331+
324332
File[] files = sourceDir.listFiles();
325-
333+
326334
if (files != null)
327335
{
328336
for (int i = 0; i < files.length; i++)

0 commit comments

Comments
 (0)