From bfa42be826bb3870c148d1608916eceba0014b2b Mon Sep 17 00:00:00 2001 From: xGladiate Date: Fri, 1 Nov 2024 18:12:02 +0800 Subject: [PATCH] Modify code to make tags optional during display for add command --- src/main/java/seedu/address/logic/Messages.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/seedu/address/logic/Messages.java b/src/main/java/seedu/address/logic/Messages.java index 5eae27d006a..92ab8b006d2 100644 --- a/src/main/java/seedu/address/logic/Messages.java +++ b/src/main/java/seedu/address/logic/Messages.java @@ -52,9 +52,11 @@ public static String format(Person person) { .append("; Email: ") .append(person.getEmail()) .append("; Address: ") - .append(person.getAddress()) - .append("; Tags: "); - person.getTags().forEach(builder::append); + .append(person.getAddress()); + if (!person.getTags().isEmpty()) { + builder.append("; Tags: "); + person.getTags().forEach(builder::append); + } return builder.toString(); }