diff --git a/astrid/plugin-src/com/todoroo/astrid/gtasks/sync/GtasksSyncV2Provider.java b/astrid/plugin-src/com/todoroo/astrid/gtasks/sync/GtasksSyncV2Provider.java index 759575600..c6fb19400 100644 --- a/astrid/plugin-src/com/todoroo/astrid/gtasks/sync/GtasksSyncV2Provider.java +++ b/astrid/plugin-src/com/todoroo/astrid/gtasks/sync/GtasksSyncV2Provider.java @@ -258,9 +258,13 @@ public class GtasksSyncV2Provider extends SyncV2Provider { // merge astrid dates with google dates if(task.task.isSaved()) { Task local = PluginServices.getTaskService().fetchById(task.task.getId(), Task.DUE_DATE, Task.COMPLETION_DATE); - mergeDates(task.task, local); - if(task.task.isCompleted() && !local.isCompleted()) - StatisticsService.reportEvent(StatisticsConstants.GTASKS_TASK_COMPLETED); + if (local == null) { + task.task.clearValue(Task.ID); + } else { + mergeDates(task.task, local); + if(task.task.isCompleted() && !local.isCompleted()) + StatisticsService.reportEvent(StatisticsConstants.GTASKS_TASK_COMPLETED); + } } else { // Set default reminders for remotely created tasks TaskDao.setDefaultReminders(task.task); }