Add check for undefined & null data in Stats component

This commit is contained in:
MariaZ
2022-09-20 12:31:27 +02:00
parent be0c11abfe
commit 1b6d21f730
+1 -1
View File
@@ -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)