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:
parent
5a64bd90cc
commit
8982e4a800
@ -104,8 +104,12 @@ public class CalendarSyncManager extends SyncManager {
|
||||
if (cEntry.isAction(SyncEntry.Actions.ADD) || cEntry.isAction(SyncEntry.Actions.CHANGE)) {
|
||||
processEvent(event, local);
|
||||
} else {
|
||||
App.log.info("Removing local record #" + local.getId() + " which has been deleted on the server");
|
||||
local.delete();
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -176,8 +176,12 @@ public class ContactsSyncManager extends SyncManager {
|
||||
if (cEntry.isAction(SyncEntry.Actions.ADD) || cEntry.isAction(SyncEntry.Actions.CHANGE)) {
|
||||
processContact(contact, local);
|
||||
} else {
|
||||
App.log.info("Removing local record #" + local.getId() + " which has been deleted on the server");
|
||||
local.delete();
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user