Merge "Fix NPE when trying to open attachments" into honeycomb-mr1

This commit is contained in:
Todd Kennedy 2011-03-10 14:23:05 -08:00 committed by Android (Google) Code Review
commit 19829ef7ed

View File

@ -868,8 +868,11 @@ public class Controller {
*/ */
public void loadAttachment(final long attachmentId, final long messageId, public void loadAttachment(final long attachmentId, final long messageId,
final long accountId) { final long accountId) {
Attachment attachInfo = Attachment.restoreAttachmentWithId(mProviderContext, attachmentId); Attachment attachInfo = Attachment.restoreAttachmentWithId(mProviderContext, attachmentId);
if (attachInfo == null) {
return;
}
if (Utility.attachmentExists(mProviderContext, attachInfo)) { if (Utility.attachmentExists(mProviderContext, attachInfo)) {
// The attachment has already been downloaded, so we will just "pretend" to download it // The attachment has already been downloaded, so we will just "pretend" to download it
// This presumably is for POP3 messages // This presumably is for POP3 messages