From b0369e3174809a31caf34a8443677b167dd37026 Mon Sep 17 00:00:00 2001 From: giavaphi Date: Mon, 21 Nov 2022 12:53:28 +0100 Subject: [PATCH] fix error edit task list --- .../ch/zhaw/gartenverwaltung/TaskFormularController.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/java/ch/zhaw/gartenverwaltung/TaskFormularController.java b/src/main/java/ch/zhaw/gartenverwaltung/TaskFormularController.java index cf8e8d5..938eea9 100644 --- a/src/main/java/ch/zhaw/gartenverwaltung/TaskFormularController.java +++ b/src/main/java/ch/zhaw/gartenverwaltung/TaskFormularController.java @@ -1,7 +1,6 @@ package ch.zhaw.gartenverwaltung; import ch.zhaw.gartenverwaltung.types.Crop; -import ch.zhaw.gartenverwaltung.types.GrowthPhaseType; import ch.zhaw.gartenverwaltung.types.Task; import javafx.fxml.FXML; import javafx.fxml.Initializable; @@ -49,8 +48,12 @@ public class TaskFormularController implements Initializable { taskName_field.setText(task.getName()); description_area.setText(task.getDescription()); start_datePicker.setValue(task.getStartDate()); - end_datePicker.setValue(task.getEndDate().get()); - interval_field.setText(task.getInterval().get().toString()); + end_datePicker.setValue(task.getEndDate().orElse(null)); + if(task.getInterval().orElse(null)!=null) { + interval_field.setText(task.getInterval().get().toString()); + } else { + interval_field.setText(null); + } } private Callback getDayCellFactory() {