Skip to content

Commit

Permalink
Fix habit creation
Browse files Browse the repository at this point in the history
  • Loading branch information
iSoron committed Jul 16, 2016
1 parent 0f12d02 commit 207f026
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ public void add(@NonNull Habit habit)
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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ public void copyFrom(Habit model)
Frequency freq = model.getFrequency();
this.freqNum = freq.getNumerator();
this.freqDen = freq.getDenominator();
this.reminderDays = 0;

if (model.hasReminder())
{
Expand Down

0 comments on commit 207f026

Please sign in to comment.