am 21b95c10
: Check for null cursor in EmailPreferenceMigrator#migrate()
* commit '21b95c1071b15a8c264c945a809d60ee284020de': Check for null cursor in EmailPreferenceMigrator#migrate()
This commit is contained in:
commit
14e4ee0be3
@ -50,6 +50,13 @@ public class EmailPreferenceMigrator extends BasePreferenceMigrator {
|
|||||||
final Cursor accountCursor = context.getContentResolver().query(Uri.parse(
|
final Cursor accountCursor = context.getContentResolver().query(Uri.parse(
|
||||||
EmailContent.CONTENT_URI + "/uiaccts"),
|
EmailContent.CONTENT_URI + "/uiaccts"),
|
||||||
UIProvider.ACCOUNTS_PROJECTION_NO_CAPABILITIES, null, null, null);
|
UIProvider.ACCOUNTS_PROJECTION_NO_CAPABILITIES, null, null, null);
|
||||||
|
|
||||||
|
if (accountCursor == null) {
|
||||||
|
LogUtils.wtf(LOG_TAG,
|
||||||
|
"Null cursor returned from query to %s when migrating accounts from %d to %d",
|
||||||
|
EmailContent.CONTENT_URI + "/uiaccts",
|
||||||
|
oldVersion, newVersion);
|
||||||
|
} else {
|
||||||
try {
|
try {
|
||||||
while (accountCursor.moveToNext()) {
|
while (accountCursor.moveToNext()) {
|
||||||
accounts.add(new Account(accountCursor));
|
accounts.add(new Account(accountCursor));
|
||||||
@ -57,6 +64,7 @@ public class EmailPreferenceMigrator extends BasePreferenceMigrator {
|
|||||||
} finally {
|
} finally {
|
||||||
accountCursor.close();
|
accountCursor.close();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
migrate(context, oldVersion, newVersion, accounts);
|
migrate(context, oldVersion, newVersion, accounts);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user