From 4460409724a90a049944cf64e7f82381ffafe22d Mon Sep 17 00:00:00 2001 From: nixonwidjaja Date: Tue, 14 Nov 2023 02:04:20 +0800 Subject: [PATCH] Fix claim bug --- src/main/java/seedu/address/logic/parser/ParserUtil.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/seedu/address/logic/parser/ParserUtil.java b/src/main/java/seedu/address/logic/parser/ParserUtil.java index 4079629a3d2..c100ea3a9e8 100644 --- a/src/main/java/seedu/address/logic/parser/ParserUtil.java +++ b/src/main/java/seedu/address/logic/parser/ParserUtil.java @@ -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; @@ -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)) {