Skip to content

Commit

Permalink
fix: added safety check on uplot-xaxis logic to solve sentry issue (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
SagarRajput-7 authored Jan 23, 2025
1 parent 1e61e6c commit af6b54a
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions frontend/src/lib/uPlotLib/utils/getUplotChartData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) || [];
Expand Down

0 comments on commit af6b54a

Please sign in to comment.