Skip to content

Commit

Permalink
fallback for month index
Browse files Browse the repository at this point in the history
  • Loading branch information
hfhelgason committed Nov 25, 2024
1 parent fd128f8 commit aecb4c2
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ export const TemporaryCalculationTable: FC<
const { watch, setValue } = useFormContext()
setValue('temporaryCalculation.show', false)
const temporaryCalculationMonth = watch('temporaryCalculation.month')
const monthIndex = MONTHS.findIndex(
(month) => month.value === temporaryCalculationMonth,
const monthIndex = Math.max(
0,
MONTHS.findIndex((month) => month.value === temporaryCalculationMonth),
)
const { categorizedIncomeTypes, incomePlanConditions } =
getApplicationExternalData(application.externalData)
Expand Down

0 comments on commit aecb4c2

Please sign in to comment.