From c0a9fa9c68a92bb8971b3506ba390ea20f424213 Mon Sep 17 00:00:00 2001 From: Marc Blank Date: Tue, 28 Jun 2011 10:58:22 -0700 Subject: [PATCH] Fix NPE Bug: 4969186 Change-Id: I27fbdf7a496ee73caf36a90bf56b91c90133b3b7 --- src/com/android/email/provider/EmailProvider.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/com/android/email/provider/EmailProvider.java b/src/com/android/email/provider/EmailProvider.java index 8e21fa1e7..eb148961c 100644 --- a/src/com/android/email/provider/EmailProvider.java +++ b/src/com/android/email/provider/EmailProvider.java @@ -877,10 +877,11 @@ public class EmailProvider extends ContentProvider { private long getMailboxIdFromMailboxTypeMap(long accountId, int type) { synchronized(mMailboxTypeMap) { HashMap accountMap = mMailboxTypeMap.get(accountId); - long mailboxId = -1; + Long mailboxId = null; if (accountMap != null) { mailboxId = accountMap.get(type); } + if (mailboxId == null) return Mailbox.NO_MAILBOX; return mailboxId; } }