fix: add null check for allDataPoints in chart data processing

This commit is contained in:
ahmadshaheer 2025-05-21 13:53:56 +04:30
parent 229922a529
commit aaabd0f904

View File

@ -30,6 +30,7 @@ export const getChartData = (
}; };
const chartLabels: ChartData<'line'>['labels'] = []; const chartLabels: ChartData<'line'>['labels'] = [];
if (allDataPoints)
Object.keys(allDataPoints).forEach((timestamp) => { Object.keys(allDataPoints).forEach((timestamp) => {
const key = allDataPoints[timestamp]; const key = allDataPoints[timestamp];
if (key.value) { if (key.value) {