Merge "Don't return a null cursor from queries to uimessages" into jb-ub-mail-ur10

This commit is contained in:
Tony Mantler 2013-09-18 18:03:59 +00:00 committed by Android (Google) Code Review
commit 75e71b3b97

View File

@ -3709,8 +3709,9 @@ public class EmailProvider extends ContentProvider {
long mailboxId = Long.parseLong(id); long mailboxId = Long.parseLong(id);
final Folder folder = getFolder(context, mailboxId); final Folder folder = getFolder(context, mailboxId);
if (folder == null) { if (folder == null) {
// This mailboxId is bogus. // This mailboxId is bogus. Return an empty cursor
return null; // TODO: Make callers of this query handle null cursors instead b/10819309
return new MatrixCursor(uiProjection);
} }
if (isVirtualMailbox(mailboxId)) { if (isVirtualMailbox(mailboxId)) {
c = getVirtualMailboxMessagesCursor(db, uiProjection, mailboxId, unseenOnly); c = getVirtualMailboxMessagesCursor(db, uiProjection, mailboxId, unseenOnly);