Skip to content

Commit

Permalink
Fix issue with null input in add job window
Browse files Browse the repository at this point in the history
  • Loading branch information
c0j0s committed Mar 29, 2023
1 parent 3217dbd commit 49f4067
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/main/java/seedu/address/ui/jobs/AddDeliveryJobWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ private void createDeliveryJob() {
job = new DeliveryJob(
inputSender.getText(),
inputRecipient.getText(),
inputDeliveryDate.getValue().format(DeliveryDate.VALID_FORMAT),
inputDeliveryDate.getValue().toString(),
Integer.toString(inputDeliverySlot.getSelectionModel().getSelectedIndex()),
inputEarning.getText(),
inputDescription.getText());
Expand Down Expand Up @@ -349,7 +349,7 @@ private void handleExit() {
primaryStage.hide();
}

boolean validateFields() {
private boolean validateFields() {
boolean flag = true;
if (inputSender.getText().isEmpty()) {
inputSender.getStyleClass().add("error-input");
Expand Down Expand Up @@ -417,6 +417,9 @@ boolean validateFields() {
flag = false;
}
}
} else {
inputDeliverySlot.setValue(null);
inputDeliveryDate.setValue(null);
}
}

Expand Down

0 comments on commit 49f4067

Please sign in to comment.