Skip to content

Commit

Permalink
Added '?' operator to fix possible null error
Browse files Browse the repository at this point in the history
  • Loading branch information
danetsao committed Sep 21, 2023
1 parent 15db52a commit 70c01f1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/forms/CalendarForm/validation/validateExceptions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -248,11 +248,11 @@ export function validateExceptionInterOverlaps(
const rowMinMaxes: { i: number; startDate: Dayjs; endDate: Dayjs }[] =
rows.map((row) => ({
i: row.i,
startDate: dayjs
.min(row.rows.map(({ startDate }) => dayjs(startDate)))
startDate: dayjs?.min(row.rows
.map(({ startDate }) => dayjs(startDate)))
.startOf('day'),
endDate: dayjs
.max(row.rows.map(({ endDate }) => dayjs(endDate)))
endDate: dayjs?.max(row.rows
.map(({ endDate }) => dayjs(endDate)))
.endOf('day')
}));

Expand Down

0 comments on commit 70c01f1

Please sign in to comment.