From af6b54aeb4d1492f5385fe9c3cabf57358d71cbf Mon Sep 17 00:00:00 2001 From: SagarRajput-7 <162284829+SagarRajput-7@users.noreply.github.com> Date: Fri, 24 Jan 2025 03:48:47 +0530 Subject: [PATCH] fix: added safety check on uplot-xaxis logic to solve sentry issue (#6869) --- frontend/src/lib/uPlotLib/utils/getUplotChartData.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/frontend/src/lib/uPlotLib/utils/getUplotChartData.ts b/frontend/src/lib/uPlotLib/utils/getUplotChartData.ts index 695b2c07de..1e224da05a 100644 --- a/frontend/src/lib/uPlotLib/utils/getUplotChartData.ts +++ b/frontend/src/lib/uPlotLib/utils/getUplotChartData.ts @@ -9,10 +9,12 @@ import { generateColor } from './generateColor'; function getXAxisTimestamps(seriesList: QueryData[]): number[] { const timestamps = new Set(); - seriesList.forEach((series: { values: [number, string][] }) => { - series.values.forEach((value) => { - timestamps.add(value[0]); - }); + seriesList.forEach((series: { values?: [number, string][] }) => { + if (series?.values) { + series.values.forEach((value) => { + timestamps.add(value[0]); + }); + } }); const timestampsArr: number[] | unknown[] = Array.from(timestamps) || [];