am a1401e1c: am 1ae6e4d9: am 4e794038: am 123d4028: Make sure to close a cursor

* commit 'a1401e1c87cb6fe339d2709c67c628c4132241e4':
  Make sure to close a cursor
This commit is contained in:
Martin Hibdon 2014-11-02 18:52:41 +00:00 committed by Android Git Automerger
commit ffc9591cfc

View File

@ -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