fix: add safety check to check if anomaly rule in uplot chart options (#6343)

This commit is contained in:
Yunus M 2024-11-01 22:51:09 +05:30 committed by GitHub
parent 7b18c3ba06
commit 4978fb9599
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -163,7 +163,8 @@ export const getUPlotChartOptions = ({
const stackBarChart = stackChart && isUndefined(hiddenGraph);
const isAnomalyRule = apiResponse?.data?.newResult?.data?.result[0].isAnomaly;
const isAnomalyRule =
apiResponse?.data?.newResult?.data?.result[0]?.isAnomaly || false;
const series = getStackedSeries(apiResponse?.data?.result || []);