From 55f121ac346e23ecd2ae550975caa616ccc4e293 Mon Sep 17 00:00:00 2001 From: tejas-1405 Date: Wed, 10 Apr 2024 11:42:45 +0800 Subject: [PATCH] Fix empty description error --- src/main/java/seedu/address/ui/DisplayListPanel.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/seedu/address/ui/DisplayListPanel.java b/src/main/java/seedu/address/ui/DisplayListPanel.java index a706542bc35..25a49a3c74f 100644 --- a/src/main/java/seedu/address/ui/DisplayListPanel.java +++ b/src/main/java/seedu/address/ui/DisplayListPanel.java @@ -49,7 +49,7 @@ public DisplayListPanel(Person person, CommandBox.CommandExecutor commandExecuto DisplayPerson displayPerson = new DisplayPerson(person); displayListView.setCellFactory(listView -> new DisplayListPanel.PersonListViewCell()); displayListView.setItems(displayPerson.getFieldDescriptions()); - descriptionTextArea.setText(person.getDescription().get().value); + descriptionTextArea.setText(person.getDescription().map(Object::toString).orElse("")); descriptionTextArea.textProperty().addListener((unused1, unused2, unused3) -> setStyleToDefault()); descriptionTextArea.setOnKeyPressed(event -> handleDescriptionEntered(event.getCode()));