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