From 4978fb95997dbd8709778cfb399972539810a01f Mon Sep 17 00:00:00 2001 From: Yunus M Date: Fri, 1 Nov 2024 22:51:09 +0530 Subject: [PATCH] fix: add safety check to check if anomaly rule in uplot chart options (#6343) --- frontend/src/lib/uPlotLib/getUplotChartOptions.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/src/lib/uPlotLib/getUplotChartOptions.ts b/frontend/src/lib/uPlotLib/getUplotChartOptions.ts index 78617669a2..9a42a6df94 100644 --- a/frontend/src/lib/uPlotLib/getUplotChartOptions.ts +++ b/frontend/src/lib/uPlotLib/getUplotChartOptions.ts @@ -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 || []);