Don't delete resources without file name (fixes #33)

This commit is contained in:
Ricki Hirner 2013-10-27 00:14:55 +02:00 committed by rfc2822
parent 68ccdca54f
commit 3b4ef177b3

View file

@ -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");
}