Skip to content

Commit

Permalink
Fix potential panic on dashboards
Browse files Browse the repository at this point in the history
Closes #921
  • Loading branch information
julienduchesne committed Jun 5, 2023
1 parent 8e41b33 commit a2c0859
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/resources/grafana/resource_dashboard.go
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ func NormalizeDashboardConfigJSON(config interface{}) string {
// from the dashboard JSON other than "name" or "uid".
// Grafana will populate all other libraryPanel attributes, so delete them to avoid diff.
panels, hasPanels := dashboardJSON["panels"]
if hasPanels {
if hasPanels && panels != nil {
for _, panel := range panels.([]interface{}) {
panelMap := panel.(map[string]interface{})
delete(panelMap, "id")
Expand Down

0 comments on commit a2c0859

Please sign in to comment.