From 643fa34aeebee463de8b3cb46fcd1a876e9f2664 Mon Sep 17 00:00:00 2001 From: "grafana-delivery-bot[bot]" <132647405+grafana-delivery-bot[bot]@users.noreply.github.com> Date: Tue, 25 Jul 2023 14:31:05 -0700 Subject: [PATCH] [v10.0.x] XYChart: Prevent crash on point hover (#72312) XYChart: Prevent crash on point hover (#70225) (cherry picked from commit 88988e43374b660d4b452e78b93c0bcddc48a84c) Co-authored-by: Coen van Leeuwen --- public/app/plugins/panel/xychart/TooltipView.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/app/plugins/panel/xychart/TooltipView.tsx b/public/app/plugins/panel/xychart/TooltipView.tsx index 33906bf704b..5be8db895f2 100644 --- a/public/app/plugins/panel/xychart/TooltipView.tsx +++ b/public/app/plugins/panel/xychart/TooltipView.tsx @@ -82,8 +82,8 @@ export const TooltipView = ({ let yValue: YValue | null = null; let extraFacets: ExtraFacets | null = null; if (seriesMapping === SeriesMapping.Manual && manualSeriesConfigs) { - const colorFacetFieldName = manualSeriesConfigs[hoveredPointIndex].pointColor?.field ?? ''; - const sizeFacetFieldName = manualSeriesConfigs[hoveredPointIndex].pointSize?.field ?? ''; + const colorFacetFieldName = manualSeriesConfigs[hoveredPointIndex]?.pointColor?.field ?? ''; + const sizeFacetFieldName = manualSeriesConfigs[hoveredPointIndex]?.pointSize?.field ?? ''; const colorFacet = colorFacetFieldName ? findField(frame, colorFacetFieldName) : undefined; const sizeFacet = sizeFacetFieldName ? findField(frame, sizeFacetFieldName) : undefined;