From 88988e43374b660d4b452e78b93c0bcddc48a84c Mon Sep 17 00:00:00 2001 From: Coen van Leeuwen Date: Tue, 25 Jul 2023 23:20:00 +0200 Subject: [PATCH] XYChart: Prevent crash on point hover (#70225) --- 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 bf8256bf309..5bfe57ff54c 100644 --- a/public/app/plugins/panel/xychart/TooltipView.tsx +++ b/public/app/plugins/panel/xychart/TooltipView.tsx @@ -72,8 +72,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;