From 199dbc4a5e260a2643a533cb84f9938b0c186742 Mon Sep 17 00:00:00 2001 From: MarcoGoC Date: Wed, 27 Mar 2024 17:59:07 -0400 Subject: [PATCH] bug 189595 fix --- utils/api/definitions/schemas.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/utils/api/definitions/schemas.ts b/utils/api/definitions/schemas.ts index c345023b5..045848885 100644 --- a/utils/api/definitions/schemas.ts +++ b/utils/api/definitions/schemas.ts @@ -157,7 +157,11 @@ export const RequestSchema = Joi.object({ }) } - const duration: MonthsYears = JSON.parse(oasDeferDuration) + const duration: MonthsYears = + oasDeferDuration !== undefined + ? JSON.parse(oasDeferDuration) + : { years: 0, months: 0 } + const durationFloat = duration.years + duration.months / 12 if (livingCountry === LivingCountry.CANADA) {