From 9f7d0bd3224ae450d8c038b5c3515682898af007 Mon Sep 17 00:00:00 2001 From: Sam Bosley Date: Wed, 4 Jan 2012 16:34:17 -0800 Subject: [PATCH] Sanity checks to prevent null pointer exceptions in sync service --- .../com/todoroo/astrid/actfm/sync/ActFmSyncService.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/astrid/plugin-src/com/todoroo/astrid/actfm/sync/ActFmSyncService.java b/astrid/plugin-src/com/todoroo/astrid/actfm/sync/ActFmSyncService.java index b4633a47f..a048cf77a 100644 --- a/astrid/plugin-src/com/todoroo/astrid/actfm/sync/ActFmSyncService.java +++ b/astrid/plugin-src/com/todoroo/astrid/actfm/sync/ActFmSyncService.java @@ -412,7 +412,8 @@ public final class ActFmSyncService { */ public void pushTask(long taskId) { Task task = taskService.fetchById(taskId, Task.PROPERTIES); - pushTaskOnSave(task, task.getMergedValues()); + if (task != null) + pushTaskOnSave(task, task.getMergedValues()); } /** @@ -421,7 +422,8 @@ public final class ActFmSyncService { */ public void pushTag(long tagId) { TagData tagData = tagDataService.fetchById(tagId, TagData.PROPERTIES); - pushTagDataOnSave(tagData, tagData.getMergedValues()); + if (tagData != null) + pushTagDataOnSave(tagData, tagData.getMergedValues()); } /** @@ -430,7 +432,8 @@ public final class ActFmSyncService { */ public void pushUpdate(long updateId) { Update update = updateDao.fetch(updateId, Update.PROPERTIES); - pushUpdateOnSave(update, update.getMergedValues(), null); + if (update != null) + pushUpdateOnSave(update, update.getMergedValues(), null); } /**