some coding practice and potential bug fixes
This commit is contained in:
@@ -178,7 +178,10 @@ public class Database extends SQLiteOpenHelper {
|
|||||||
}
|
}
|
||||||
} while (cursor.moveToNext());
|
} while (cursor.moveToNext());
|
||||||
}
|
}
|
||||||
cursor.close();
|
|
||||||
|
if (cursor != null) {
|
||||||
|
cursor.close();
|
||||||
|
}
|
||||||
|
|
||||||
cursor = db.query(SecretKeys.TABLE_NAME,
|
cursor = db.query(SecretKeys.TABLE_NAME,
|
||||||
new String[]{
|
new String[]{
|
||||||
@@ -454,7 +457,10 @@ public class Database extends SQLiteOpenHelper {
|
|||||||
} else {
|
} else {
|
||||||
rowId = mDb.insert(Keys.TABLE_NAME, Keys.KEY_DATA, values);
|
rowId = mDb.insert(Keys.TABLE_NAME, Keys.KEY_DATA, values);
|
||||||
}
|
}
|
||||||
c.close();
|
|
||||||
|
if (c != null) {
|
||||||
|
c.close();
|
||||||
|
}
|
||||||
|
|
||||||
return rowId;
|
return rowId;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user