diff --git a/src/main/java/seedu/address/ui/ClientDetailedView.java b/src/main/java/seedu/address/ui/ClientDetailedView.java index b4bd22023e0..5a52f29d046 100644 --- a/src/main/java/seedu/address/ui/ClientDetailedView.java +++ b/src/main/java/seedu/address/ui/ClientDetailedView.java @@ -12,6 +12,7 @@ import seedu.address.commons.core.LogsCenter; import seedu.address.model.client.Birthday; import seedu.address.model.client.Client; +import seedu.address.model.client.Email; import seedu.address.model.meeting.Meeting; /** @@ -50,7 +51,7 @@ public ClientDetailedView(Client client) { this.client = client; clientName.setText(client.getName().toString()); phoneNumber.setText(client.getPhone().toString()); - email.setText(client.getEmail().get().toString()); + email.setText(client.getEmail().map(Email::toString).orElse("")); Optional clientBirthday = client.getBirthday(); if (clientBirthday.isEmpty()) { birthday.setText("");