From 8ba26e2f090554912d255c34fdab81417e8c03c0 Mon Sep 17 00:00:00 2001 From: "Grot (@grafanabot)" <43478413+grafanabot@users.noreply.github.com> Date: Mon, 31 May 2021 14:44:24 -0400 Subject: [PATCH] Secure from custom config being undefined in PlotLegend (#34975) (#35006) (cherry picked from commit 823581add8491191f11a8917e44fec0745f44ae1) Co-authored-by: Dominik Prokop --- 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; }