fix nullpointer exception check date garden schedule
This commit is contained in:
parent
2452e42b72
commit
ec42a6e75a
|
@ -147,12 +147,14 @@ public class GardenSchedule {
|
|||
final int finalI = i;
|
||||
weekTasks.forEach(task -> {
|
||||
LocalDate checkDate = task.getNextExecution();
|
||||
if (checkDate != null) {
|
||||
do {
|
||||
if (date.equals(checkDate) && !date.isAfter(task.getEndDate().orElse(LocalDate.MIN))) {
|
||||
dayTaskList.get(finalI).add(task);
|
||||
}
|
||||
checkDate = checkDate.plusDays(task.getInterval().orElse(0));
|
||||
} while (!(task.getInterval().orElse(0) == 0) && checkDate.isBefore(LocalDate.now().plusDays(listLength)));
|
||||
}
|
||||
});
|
||||
}
|
||||
return dayTaskList;
|
||||
|
|
Loading…
Reference in New Issue