Don't double-index

This commit is contained in:
Pieter Noordhuis 2024-10-18 16:21:39 +02:00
parent 379d263907
commit 3201821a62
No known key found for this signature in database
GPG Key ID: 12ACCCC104CF2930
1 changed files with 6 additions and 2 deletions

View File

@ -213,8 +213,12 @@ func (m *applyPresets) Apply(ctx context.Context, b *bundle.Bundle) diag.Diagnos
} }
// Dashboards: Prefix // Dashboards: Prefix
for i := range r.Dashboards { for key, dashboard := range r.Dashboards {
r.Dashboards[i].DisplayName = prefix + r.Dashboards[i].DisplayName if dashboard == nil {
diags = diags.Extend(diag.Errorf("dashboard %s s is not defined", key))
continue
}
dashboard.DisplayName = prefix + dashboard.DisplayName
} }
return diags return diags