1
0
mirror of https://github.com/etesync/android synced 2025-01-11 08:10:58 +00:00

Don't crash when deleting a non-existent record

This shouldn't even happen, but it apparently happened to a user. This
commit changes it so it logs a warning instead of crashing.
This commit is contained in:
Tom Hacohen 2018-04-11 10:17:31 +01:00
parent 5a64bd90cc
commit 8982e4a800
2 changed files with 12 additions and 4 deletions

View File

@ -104,8 +104,12 @@ public class CalendarSyncManager extends SyncManager {
if (cEntry.isAction(SyncEntry.Actions.ADD) || cEntry.isAction(SyncEntry.Actions.CHANGE)) {
processEvent(event, local);
} else {
if (local != null) {
App.log.info("Removing local record #" + local.getId() + " which has been deleted on the server");
local.delete();
} else {
App.log.warning("Tried deleting a non-existent record: " + event.uid);
}
}
}

View File

@ -176,8 +176,12 @@ public class ContactsSyncManager extends SyncManager {
if (cEntry.isAction(SyncEntry.Actions.ADD) || cEntry.isAction(SyncEntry.Actions.CHANGE)) {
processContact(contact, local);
} else {
if (local != null) {
App.log.info("Removing local record #" + local.getId() + " which has been deleted on the server");
local.delete();
} else {
App.log.warning("Tried deleting a non-existent record: " + contact.uid);
}
}
}