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; }