From 9d120a22059e82bbb385ed95193cd3cb4df2e597 Mon Sep 17 00:00:00 2001 From: ethan-goh Date: Tue, 12 Nov 2024 11:45:12 +0800 Subject: [PATCH] Fix bugs pertaining to PE-D --- src/main/java/seedu/address/logic/commands/ClearCommand.java | 3 ++- .../java/seedu/address/logic/parser/EditCommandParser.java | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/seedu/address/logic/commands/ClearCommand.java b/src/main/java/seedu/address/logic/commands/ClearCommand.java index d4371271789..9e4b1b0de23 100644 --- a/src/main/java/seedu/address/logic/commands/ClearCommand.java +++ b/src/main/java/seedu/address/logic/commands/ClearCommand.java @@ -18,6 +18,7 @@ public class ClearCommand extends Command { public CommandResult execute(Model model) { requireNonNull(model); model.setEduContacts(new EduContacts()); - return new CommandResult(MESSAGE_SUCCESS); + model.setPersonToDisplay(null); + return new CommandResult(MESSAGE_SUCCESS, true); } } diff --git a/src/main/java/seedu/address/logic/parser/EditCommandParser.java b/src/main/java/seedu/address/logic/parser/EditCommandParser.java index e7ec13ed603..9b7b88376da 100644 --- a/src/main/java/seedu/address/logic/parser/EditCommandParser.java +++ b/src/main/java/seedu/address/logic/parser/EditCommandParser.java @@ -49,7 +49,7 @@ public EditCommand parse(String args) throws ParseException { throw new ParseException(String.format(MESSAGE_INVALID_COMMAND_FORMAT, EditCommand.MESSAGE_USAGE)); } - String[] modules = argMultimap.getValue(PREFIX_MODULE).get().split(" "); + String[] modules = argMultimap.getValue(PREFIX_MODULE).get().trim().replaceAll("\\s+", " ").split(" "); if (modules.length != 2) { throw new ParseException(String.format(MESSAGE_INVALID_COMMAND_FORMAT, EditCommand.MESSAGE_USAGE)); }