From 4f2c1b18997ccbb970fe9929a03f92e202a6c19d Mon Sep 17 00:00:00 2001 From: Darren-Tung <40617230+Darren-Tung@users.noreply.github.com> Date: Wed, 9 Oct 2024 23:38:02 +0800 Subject: [PATCH] Update JsonAdaptedPerson.java To fix the bug --- src/main/java/seedu/address/storage/JsonAdaptedPerson.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/seedu/address/storage/JsonAdaptedPerson.java b/src/main/java/seedu/address/storage/JsonAdaptedPerson.java index 8338ea81e18..d10687f8616 100644 --- a/src/main/java/seedu/address/storage/JsonAdaptedPerson.java +++ b/src/main/java/seedu/address/storage/JsonAdaptedPerson.java @@ -109,6 +109,9 @@ public Person toModelType() throws IllegalValueException { if (note == null) { throw new IllegalValueException(String.format(MISSING_FIELD_MESSAGE_FORMAT, Note.class.getSimpleName())); } + if (!Note.isValidNote(note)) { + throw new IllegalValueException(Note.MESSAGE_CONSTRAINTS); + } final Note modelNote = new Note(note); final Set modelTags = new HashSet<>(personTags);