From f2436d2a04fc38ba489b286b228521cc61e4d6f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Omar=20L=C3=B3pez?= Date: Fri, 1 Apr 2022 11:04:29 -0700 Subject: [PATCH] Urgent fix for team bookings (#2352) --- apps/web/lib/hooks/useSlots.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/web/lib/hooks/useSlots.ts b/apps/web/lib/hooks/useSlots.ts index ce400e42..a54e31e5 100644 --- a/apps/web/lib/hooks/useSlots.ts +++ b/apps/web/lib/hooks/useSlots.ts @@ -44,7 +44,7 @@ type getFilteredTimesProps = { export const getFilteredTimes = (props: getFilteredTimesProps) => { const { times, busy, eventLength, beforeBufferTime, afterBufferTime } = props; - const finalizationTime = times[times.length - 1].add(eventLength, "minutes"); + const finalizationTime = times[times.length - 1]?.add(eventLength, "minutes"); // Check for conflicts for (let i = times.length - 1; i >= 0; i -= 1) { // const totalSlotLength = eventLength + beforeBufferTime + afterBufferTime;