Skip to content
This repository was archived by the owner on Jun 27, 2020. It is now read-only.
Next Next commit
[30m]. Fix the issue with empty category when adding a record with ex…
…isting one.
  • Loading branch information
Evgenii Kanivets committed Feb 15, 2016
commit ecd1a72e744e5cb67725a3fcde708576cf38f332
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,10 @@ public List<Record> getRecords(Period period) {

public void addRecord(Record record) {
//Add category if it does not exist yet
if (categoryController.getCategoryIdByName(record.getCategory()) == -1) {
if (categoryController.getCategoryIdByName(record.getCategory()) == -1)
categoryController.addCategory(record.getCategory());
record.setCategoryId(categoryController.getCategoryIdByName(record.getCategory()));
}

record.setCategoryId(categoryController.getCategoryIdByName(record.getCategory()));

//Add record to DB
SQLiteDatabase db = dbHelper.getWritableDatabase();
Expand Down