From 1f6fddc0e5b67f1dd1e679f5e87f1c3fe3cf0e70 Mon Sep 17 00:00:00 2001 From: Nick Mowen Date: Thu, 4 Jan 2024 07:30:17 -0700 Subject: [PATCH] Protect against hour with no cards --- web/src/utils/historyUtil.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/web/src/utils/historyUtil.ts b/web/src/utils/historyUtil.ts index d9c6b88c0..94eaf2941 100644 --- a/web/src/utils/historyUtil.ts +++ b/web/src/utils/historyUtil.ts @@ -149,10 +149,8 @@ export function getTimelineHoursForDay( end = startDay.getTime() / 1000; const hour = Object.values(day).find((cards) => { - if ( - Object.values(cards)[0].time < start || - Object.values(cards)[0].time > end - ) { + const card = Object.values(cards)[0]; + if (card == undefined || card.time < start || card.time > end) { return false; }