fix: added safety check on uplot-xaxis logic to solve sentry issue (#6869)

This commit is contained in:
SagarRajput-7 2025-01-24 03:48:47 +05:30 committed by GitHub
parent 1e61e6c2f6
commit af6b54aeb4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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) || [];