From 3201821a628fb9e31645139d5fb111b7c38c33c4 Mon Sep 17 00:00:00 2001 From: Pieter Noordhuis Date: Fri, 18 Oct 2024 16:21:39 +0200 Subject: [PATCH] Don't double-index --- bundle/config/mutator/apply_presets.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/bundle/config/mutator/apply_presets.go b/bundle/config/mutator/apply_presets.go index e2354130..3d1f3d76 100644 --- a/bundle/config/mutator/apply_presets.go +++ b/bundle/config/mutator/apply_presets.go @@ -213,8 +213,12 @@ func (m *applyPresets) Apply(ctx context.Context, b *bundle.Bundle) diag.Diagnos } // Dashboards: Prefix - for i := range r.Dashboards { - r.Dashboards[i].DisplayName = prefix + r.Dashboards[i].DisplayName + for key, dashboard := range r.Dashboards { + if dashboard == nil { + diags = diags.Extend(diag.Errorf("dashboard %s s is not defined", key)) + continue + } + dashboard.DisplayName = prefix + dashboard.DisplayName } return diags