mirror of
https://github.com/iSoron/uhabits.git
synced 2025-12-06 01:08:50 -06:00
Fix habit creation
This commit is contained in:
@@ -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())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user