From 1dd937bf18fbd9c4967fbfdb5179508dd0a823fd Mon Sep 17 00:00:00 2001 From: Yu Ping Hu Date: Tue, 26 Mar 2013 14:45:36 -0700 Subject: [PATCH] Prevent NPE when getting a bad mailbox id. The mailboxNotification query apparently can return bogus mailbox ids. This underlying bug still needs fixing. Bug: 8482721 Change-Id: Icfbd0d986ab32fe878a0dbe09a3276322c75cafe --- src/com/android/email/NotificationController.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/com/android/email/NotificationController.java b/src/com/android/email/NotificationController.java index d4a6e9be0..be3e876be 100644 --- a/src/com/android/email/NotificationController.java +++ b/src/com/android/email/NotificationController.java @@ -583,13 +583,16 @@ public class NotificationController { if (folderCursor == null) { LogUtils.e(LOG_TAG, "Null folder cursor for mMailboxId %d", mailboxId); - return; + continue; } Folder folder = null; try { if (folderCursor.moveToFirst()) { folder = new Folder(folderCursor); + } else { + LogUtils.e(LOG_TAG, "Empty folder cursor for mMailboxId %d", mailboxId); + continue; } } finally { folderCursor.close();