Fix NPE from null Folder

Catch empty folder cursor in migrate() and log error message and
continue as with other empty cursor handling in loop.

Bug:15854046
Change-Id: I13c0a1909755f62f318d7c2b237adb03df68ba86
This commit is contained in:
Jay Shrauner 2014-06-24 10:40:47 -07:00
parent 5f24f6f2e5
commit 5bcb36eb10

View File

@ -136,6 +136,11 @@ public class EmailPreferenceMigrator extends BasePreferenceMigrator {
try {
if (folderCursor.moveToFirst()) {
folder = new Folder(folderCursor);
} else {
LogUtils.e(LOG_TAG, "Empty folder cursor for mailbox %s",
LogUtils.sanitizeName(LOG_TAG,
account.settings.defaultInbox.toString()));
continue;
}
} finally {
folderCursor.close();