From 823581add8491191f11a8917e44fec0745f44ae1 Mon Sep 17 00:00:00 2001 From: Dominik Prokop Date: Mon, 31 May 2021 19:37:34 +0200 Subject: [PATCH] Secure from custom config being undefined in PlotLegend (#34975) --- packages/grafana-ui/src/components/uPlot/PlotLegend.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/grafana-ui/src/components/uPlot/PlotLegend.tsx b/packages/grafana-ui/src/components/uPlot/PlotLegend.tsx index e952349056e..08cf4ec3c99 100644 --- a/packages/grafana-ui/src/components/uPlot/PlotLegend.tsx +++ b/packages/grafana-ui/src/components/uPlot/PlotLegend.tsx @@ -35,7 +35,7 @@ export const PlotLegend: React.FC = ({ const field = data[fieldIndex.frameIndex]?.fields[fieldIndex.fieldIndex]; - if (!field || field.config.custom.hideFrom?.legend) { + if (!field || field.config.custom?.hideFrom?.legend) { return undefined; }