am 19829ef7: Merge "Fix NPE when trying to open attachments" into honeycomb-mr1

* commit '19829ef7edfe1a72a88e0ba57f3ce6c57d9ae8f6':
  Fix NPE when trying to open attachments
This commit is contained in:
Todd Kennedy 2011-03-10 14:27:19 -08:00 committed by Android Git Automerger
commit d43ebd7804

View File

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