From 782c21e953f3a157b2771cb15e097ed812e27ab1 Mon Sep 17 00:00:00 2001 From: Marc Blank Date: Tue, 11 Jan 2011 11:45:36 -0800 Subject: [PATCH] Check download request before trying to remove it from the queue Bug: 3312633 Change-Id: I443d9a8f786f93c7cd72b6b96ea838bf0d05f4d4 --- .../email/service/AttachmentDownloadService.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/com/android/email/service/AttachmentDownloadService.java b/src/com/android/email/service/AttachmentDownloadService.java index b317b9571..53809a383 100644 --- a/src/com/android/email/service/AttachmentDownloadService.java +++ b/src/com/android/email/service/AttachmentDownloadService.java @@ -16,12 +16,12 @@ package com.android.email.service; -import com.android.email.Controller.ControllerService; import com.android.email.Email; -import com.android.email.ExchangeUtils.NullEmailService; import com.android.email.NotificationController; import com.android.email.Preferences; import com.android.email.Utility; +import com.android.email.Controller.ControllerService; +import com.android.email.ExchangeUtils.NullEmailService; import com.android.email.provider.AttachmentProvider; import com.android.email.provider.EmailContent; import com.android.email.provider.EmailContent.Account; @@ -487,8 +487,10 @@ public class AttachmentDownloadService extends Service implements Runnable { return; } - // Remove the request from the queue - remove(req); + // If the request is still in the queue, remove it + if (req != null) { + remove(req); + } if (Email.DEBUG) { long secs = 0; if (req != null) {