* commit 'ffc9591cfcfcbc4811a003241e27c20de51afd59': Make sure to close a cursor
This commit is contained in:
commit
f214c7effe
@ -225,11 +225,17 @@ public final class Account extends EmailContent implements Parcelable {
|
||||
new String[] {AccountColumns._ID},
|
||||
AccountColumns.EMAIL_ADDRESS + "=?", new String[] {emailAddress},
|
||||
null);
|
||||
try {
|
||||
if (c == null || !c.moveToFirst()) {
|
||||
return null;
|
||||
}
|
||||
final long id = c.getLong(c.getColumnIndex(AccountColumns._ID));
|
||||
return restoreAccountWithId(context, id, observer);
|
||||
} finally {
|
||||
if (c != null) {
|
||||
c.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user