mirror of
https://github.com/etesync/android
synced 2025-06-18 05:58:47 +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:
parent
5a64bd90cc
commit
8982e4a800
@ -104,8 +104,12 @@ public class CalendarSyncManager extends SyncManager {
|
|||||||
if (cEntry.isAction(SyncEntry.Actions.ADD) || cEntry.isAction(SyncEntry.Actions.CHANGE)) {
|
if (cEntry.isAction(SyncEntry.Actions.ADD) || cEntry.isAction(SyncEntry.Actions.CHANGE)) {
|
||||||
processEvent(event, local);
|
processEvent(event, local);
|
||||||
} else {
|
} else {
|
||||||
|
if (local != null) {
|
||||||
App.log.info("Removing local record #" + local.getId() + " which has been deleted on the server");
|
App.log.info("Removing local record #" + local.getId() + " which has been deleted on the server");
|
||||||
local.delete();
|
local.delete();
|
||||||
|
} else {
|
||||||
|
App.log.warning("Tried deleting a non-existent record: " + event.uid);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -176,8 +176,12 @@ public class ContactsSyncManager extends SyncManager {
|
|||||||
if (cEntry.isAction(SyncEntry.Actions.ADD) || cEntry.isAction(SyncEntry.Actions.CHANGE)) {
|
if (cEntry.isAction(SyncEntry.Actions.ADD) || cEntry.isAction(SyncEntry.Actions.CHANGE)) {
|
||||||
processContact(contact, local);
|
processContact(contact, local);
|
||||||
} else {
|
} else {
|
||||||
|
if (local != null) {
|
||||||
App.log.info("Removing local record #" + local.getId() + " which has been deleted on the server");
|
App.log.info("Removing local record #" + local.getId() + " which has been deleted on the server");
|
||||||
local.delete();
|
local.delete();
|
||||||
|
} else {
|
||||||
|
App.log.warning("Tried deleting a non-existent record: " + contact.uid);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user