mirror of
https://github.com/iSoron/uhabits.git
synced 2025-12-06 09:08:52 -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();
|
if (id == null) id = record.save();
|
||||||
else record.save(id);
|
else record.save(id);
|
||||||
|
|
||||||
|
if(id < 0)
|
||||||
|
throw new IllegalArgumentException("habit could not be saved");
|
||||||
|
|
||||||
habit.setId(id);
|
habit.setId(id);
|
||||||
cache.put(id, habit);
|
cache.put(id, habit);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -147,6 +147,7 @@ public class HabitRecord extends Model implements SQLiteRecord
|
|||||||
Frequency freq = model.getFrequency();
|
Frequency freq = model.getFrequency();
|
||||||
this.freqNum = freq.getNumerator();
|
this.freqNum = freq.getNumerator();
|
||||||
this.freqDen = freq.getDenominator();
|
this.freqDen = freq.getDenominator();
|
||||||
|
this.reminderDays = 0;
|
||||||
|
|
||||||
if (model.hasReminder())
|
if (model.hasReminder())
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user