Fix habit creation

This commit is contained in:
2016-07-16 10:35:55 -04:00
parent 0f12d02990
commit 207f026ceb
2 changed files with 4 additions and 0 deletions

View File

@@ -84,6 +84,9 @@ public class SQLiteHabitList extends HabitList
if (id == null) id = record.save();
else record.save(id);
if(id < 0)
throw new IllegalArgumentException("habit could not be saved");
habit.setId(id);
cache.put(id, habit);
}

View File

@@ -147,6 +147,7 @@ public class HabitRecord extends Model implements SQLiteRecord
Frequency freq = model.getFrequency();
this.freqNum = freq.getNumerator();
this.freqDen = freq.getDenominator();
this.reminderDays = 0;
if (model.hasReminder())
{