Skip to content

Commit

Permalink
Fix claim bug
Browse files Browse the repository at this point in the history
  • Loading branch information
nixonwidjaja committed Nov 13, 2023
1 parent 0365e10 commit 4460409
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main/java/seedu/address/logic/parser/ParserUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import seedu.address.commons.core.index.Index;
import seedu.address.commons.util.StringUtil;
import seedu.address.logic.Messages;
import seedu.address.logic.parser.exceptions.ParseException;
import seedu.address.model.person.Address;
import seedu.address.model.person.Birthday;
Expand Down Expand Up @@ -157,6 +158,9 @@ public static Birthday parseDob(String dob) throws ParseException {
public static Claim parseClaim(String claimAmount) throws ParseException {
requireNonNull(claimAmount);
String trimmed = claimAmount.trim();
if (trimmed.length() > 14) {
throw new ParseException(Messages.TOO_LARGE_A_NUMBER);
}
if (!Claim.comtainsSymbol(trimmed)) {
throw new ParseException(Claim.NO_SYMBOLS_ERROR);
} else if (!Claim.isCorrectAmountType(trimmed)) {
Expand Down

0 comments on commit 4460409

Please sign in to comment.