Skip to content
This repository was archived by the owner on Jun 27, 2020. It is now read-only.

Commit ecd1a72

Browse files
author
Evgenii Kanivets
committed
[30m]. Fix the issue with empty category when adding a record with existing one.
1 parent 1a55d3a commit ecd1a72

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

app/src/main/java/com/blogspot/e_kanivets/moneytracker/controller/RecordController.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,10 @@ public List<Record> getRecords(Period period) {
110110

111111
public void addRecord(Record record) {
112112
//Add category if it does not exist yet
113-
if (categoryController.getCategoryIdByName(record.getCategory()) == -1) {
113+
if (categoryController.getCategoryIdByName(record.getCategory()) == -1)
114114
categoryController.addCategory(record.getCategory());
115-
record.setCategoryId(categoryController.getCategoryIdByName(record.getCategory()));
116-
}
115+
116+
record.setCategoryId(categoryController.getCategoryIdByName(record.getCategory()));
117117

118118
//Add record to DB
119119
SQLiteDatabase db = dbHelper.getWritableDatabase();

0 commit comments

Comments
 (0)