Fixed a potential crash when trying to upload attachments for an unsynced task

pull/14/head
Sam Bosley 12 years ago
parent f470f1924e
commit 49ab140a9d

@ -597,7 +597,7 @@ public final class ActFmSyncService {
taskPushThreads.incrementAndGet();
try {
Task t = taskDao.fetch(fileMetadata.getValue(Metadata.TASK), Task.REMOTE_ID);
if (t == null || t.getValue(Task.REMOTE_ID) <= 0)
if (t == null || t.getValue(Task.REMOTE_ID) == null || t.getValue(Task.REMOTE_ID) <= 0)
return;
if (fileMetadata.getValue(FileMetadata.DELETION_DATE) > 0)
deleteAttachment(fileMetadata);

Loading…
Cancel
Save