Skip to content

Commit

Permalink
Merge pull request #239 from AY2324S1-CS2103T-F08-0/bugfix-add-tutorial
Browse files Browse the repository at this point in the history
Fix bug when parsing tutorials
  • Loading branch information
xxiaoweii authored Nov 11, 2023
2 parents 4a34707 + cbae47b commit ad8db4d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main/java/seedu/address/logic/parser/ParserUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

import seedu.address.commons.core.index.Index;
import seedu.address.commons.util.StringUtil;
import seedu.address.logic.commands.AddCommand;
import seedu.address.logic.parser.exceptions.ParseException;
import seedu.address.model.person.Contact;
import seedu.address.model.person.Course;
Expand Down Expand Up @@ -173,6 +174,8 @@ public static Set<Course> parseCourseInput(Collection<String> courseCollection)
if (courseTutorialLength == 2) {
Course stringToCourse = new Course(splitCourseInput);
courseSet.add(stringToCourse);
} else if (courseTutorialLength > 2) {
throw new ParseException(AddCommand.MESSAGE_USAGE);
}
}
}
Expand Down

0 comments on commit ad8db4d

Please sign in to comment.