From b2ab24afd2973ae92586a0ff9396251986f199d7 Mon Sep 17 00:00:00 2001 From: rfc2822 Date: Sun, 27 Oct 2013 00:14:55 +0200 Subject: [PATCH] Don't delete resources without file name (fixes #33) --- src/at/bitfire/davdroid/syncadapter/SyncManager.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/at/bitfire/davdroid/syncadapter/SyncManager.java b/src/at/bitfire/davdroid/syncadapter/SyncManager.java index 5f9aa0e1..8b4e4a6e 100644 --- a/src/at/bitfire/davdroid/syncadapter/SyncManager.java +++ b/src/at/bitfire/davdroid/syncadapter/SyncManager.java @@ -49,7 +49,8 @@ public class SyncManager { Log.i(TAG, "Remotely removing " + deletedResources.length + " deleted resource(s) (if not changed)"); for (Resource res : deletedResources) { try { - dav.delete(res); + if (res.getName() != null) // is this resource even present remotely? + dav.delete(res); } catch(PreconditionFailedException e) { Log.i(TAG, "Locally-deleted resource has been changed on the server in the meanwhile"); }