Secure from custom config being undefined in PlotLegend (#34975) (#35006)

(cherry picked from commit 823581add8)

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
This commit is contained in:
Grot (@grafanabot)
2021-05-31 20:44:24 +02:00
committed by GitHub
co-authored by Dominik Prokop
parent 0b02a7e918
commit 8ba26e2f09
@@ -35,7 +35,7 @@ export const PlotLegend: React.FC<PlotLegendProps> = ({
const field = data[fieldIndex.frameIndex]?.fields[fieldIndex.fieldIndex];
if (!field || field.config.custom.hideFrom?.legend) {
if (!field || field.config.custom?.hideFrom?.legend) {
return undefined;
}