Skip to content

Commit

Permalink
Add null check for tagNames
Browse files Browse the repository at this point in the history
  • Loading branch information
aureliony committed Feb 27, 2024
1 parent 7ba691f commit e2e21bf
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/main/java/seedu/address/model/person/Person.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,10 @@ private Person(@JsonProperty("name") String name, @JsonProperty("phone") String
this.phone = new Phone(phone);
this.email = new Email(email);
this.address = new Address(address);
for (String tagName : tagNames) {
this.tags.add(new Tag(tagName));
if (tagNames != null) {
for (String tagName : tagNames) {
this.tags.add(new Tag(tagName));
}
}
}

Expand Down

0 comments on commit e2e21bf

Please sign in to comment.