From 2c3328bfd745142f3365c676527daa853fe445d6 Mon Sep 17 00:00:00 2001 From: Tony Mantler Date: Wed, 18 Sep 2013 10:53:58 -0700 Subject: [PATCH] Don't return a null cursor from queries to uimessages b/10807214 Change-Id: Ia49dae8bd50773097bb1082c2bc5cf264a76ce55 --- src/com/android/email/provider/EmailProvider.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/com/android/email/provider/EmailProvider.java b/src/com/android/email/provider/EmailProvider.java index 8c6451e7e..07a6d01c3 100644 --- a/src/com/android/email/provider/EmailProvider.java +++ b/src/com/android/email/provider/EmailProvider.java @@ -3709,8 +3709,9 @@ public class EmailProvider extends ContentProvider { long mailboxId = Long.parseLong(id); final Folder folder = getFolder(context, mailboxId); if (folder == null) { - // This mailboxId is bogus. - return null; + // This mailboxId is bogus. Return an empty cursor + // TODO: Make callers of this query handle null cursors instead b/10819309 + return new MatrixCursor(uiProjection); } if (isVirtualMailbox(mailboxId)) { c = getVirtualMailboxMessagesCursor(db, uiProjection, mailboxId, unseenOnly);