mirror of
https://github.com/iSoron/uhabits.git
synced 2025-12-06 09:08:52 -06:00
null check description
This commit is contained in:
@@ -87,7 +87,7 @@ public class HabitBullCSVImporter extends AbstractImporter
|
||||
{
|
||||
h = modelFactory.buildHabit();
|
||||
h.setName(name);
|
||||
h.setDescription(description);
|
||||
h.setDescription(description == null ? "" : description);
|
||||
h.setFrequency(Frequency.DAILY);
|
||||
habitList.add(h);
|
||||
map.put(name, h);
|
||||
|
||||
@@ -101,7 +101,7 @@ public class RewireDBImporter extends AbstractImporter
|
||||
|
||||
Habit habit = modelFactory.buildHabit();
|
||||
habit.setName(name);
|
||||
habit.setDescription(description);
|
||||
habit.setDescription(description == null ? "" : description);
|
||||
|
||||
int periods[] = { 7, 31, 365 };
|
||||
int numerator, denominator;
|
||||
|
||||
@@ -127,7 +127,7 @@ public class TickmateDBImporter extends AbstractImporter
|
||||
|
||||
Habit habit = modelFactory.buildHabit();
|
||||
habit.setName(name);
|
||||
habit.setDescription(description);
|
||||
habit.setDescription(description == null ? "" : description);
|
||||
habit.setFrequency(Frequency.DAILY);
|
||||
habitList.add(habit);
|
||||
|
||||
|
||||
@@ -148,9 +148,9 @@ public class Habit
|
||||
return data.description;
|
||||
}
|
||||
|
||||
public synchronized void setDescription(@Nullable String description)
|
||||
public synchronized void setDescription(@NonNull String description)
|
||||
{
|
||||
data.description = description == null ? "" : description;
|
||||
data.description = description;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
|
||||
@@ -226,7 +226,7 @@ public class HabitListTest extends BaseUnitTest
|
||||
Habit h2 = fixtures.createEmptyHabit();
|
||||
h2.setName("Wake up early");
|
||||
h2.setQuestion("Did you wake up before 6am?");
|
||||
h2.setDescription(null);
|
||||
h2.setDescription("");
|
||||
h2.setFrequency(new Frequency(2, 3));
|
||||
h2.setColor(5);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user