From e90b74aa0410ea93f6b40617bf721770e50585e2 Mon Sep 17 00:00:00 2001 From: satok Date: Mon, 5 Oct 2009 15:53:57 +0900 Subject: [PATCH] Avoid NPE at onRefresh in MessageList BUG: 2161449 --- src/com/android/email/activity/MessageList.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/com/android/email/activity/MessageList.java b/src/com/android/email/activity/MessageList.java index 714a59238..7e018d7e9 100644 --- a/src/com/android/email/activity/MessageList.java +++ b/src/com/android/email/activity/MessageList.java @@ -527,7 +527,9 @@ public class MessageList extends ListActivity implements OnItemClickListener, On // TODO: Should not be reading from DB in UI thread - need a cleaner way to get accountId if (mMailboxId >= 0) { Mailbox mailbox = Mailbox.restoreMailboxWithId(this, mMailboxId); - mController.updateMailbox(mailbox.mAccountKey, mMailboxId, mControllerCallback); + if (mailbox != null) { + mController.updateMailbox(mailbox.mAccountKey, mMailboxId, mControllerCallback); + } } }