Fix habit creation

pull/151/head
Alinson S. Xavier 9 years ago
parent 0f12d02990
commit 207f026ceb

@ -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);
}

@ -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())
{

Loading…
Cancel
Save