mirror of
https://github.com/UniversityOfHelsinkiCS/ohtuilmo.git
synced 2026-10-12 19:03:41 +03:00
not try to map nonexistent mappedData in timelogChart component
this prevents site from crashing when the component's mappedData prop is null.
This commit is contained in:
@@ -103,8 +103,10 @@ const TimeLogChart = (props) => {
|
||||
|
||||
useEffect(() => {
|
||||
const mappedData = mapSprintSummaryData(groupSprintSummary)
|
||||
setSprints([...new Set(mappedData.map((entry) => entry.sprint).filter((entry) => entry !== -1))])
|
||||
setChartData(mappedData)
|
||||
if (mappedData) {
|
||||
setSprints([...new Set(mappedData.map((entry) => entry.sprint).filter((entry) => entry !== -1))])
|
||||
setChartData(mappedData)
|
||||
}
|
||||
}, [groupSprintSummary])
|
||||
|
||||
if (chartData && chartData.length > 0) {
|
||||
|
||||
Reference in New Issue
Block a user