mirror of
https://github.com/moparisthebest/open-keychain
synced 2024-11-23 17:22:16 -05:00
some coding practice and potential bug fixes
This commit is contained in:
parent
b42f02ba92
commit
b943f706b6
@ -178,7 +178,10 @@ public class Database extends SQLiteOpenHelper {
|
||||
}
|
||||
} while (cursor.moveToNext());
|
||||
}
|
||||
|
||||
if (cursor != null) {
|
||||
cursor.close();
|
||||
}
|
||||
|
||||
cursor = db.query(SecretKeys.TABLE_NAME,
|
||||
new String[]{
|
||||
@ -454,7 +457,10 @@ public class Database extends SQLiteOpenHelper {
|
||||
} else {
|
||||
rowId = mDb.insert(Keys.TABLE_NAME, Keys.KEY_DATA, values);
|
||||
}
|
||||
|
||||
if (c != null) {
|
||||
c.close();
|
||||
}
|
||||
|
||||
return rowId;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user