From 1b6d21f730c9ae736b9f13a44f9e20433a8acfda Mon Sep 17 00:00:00 2001 From: MariaZ Date: Tue, 20 Sep 2022 12:31:27 +0200 Subject: [PATCH] Add check for undefined & null data in Stats component --- components/stats.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/stats.js b/components/stats.js index adcfa2a..ef061b6 100644 --- a/components/stats.js +++ b/components/stats.js @@ -23,7 +23,7 @@ const Stats = () => { const { t } = useTranslation(null, { keyPrefix: 'stats' }) const cycleLengths = cycleModule().getAllCycleLengths() - const numberOfCycles = cycleLengths.length + const numberOfCycles = cycleLengths?.length const hasAtLeastOneCycle = numberOfCycles >= 1 const cycleData = hasAtLeastOneCycle ? getCycleInfo(cycleLengths)