Skip to content

Commit

Permalink
azurerm_monitor_diagnostic_setting - Fix crash around `retention_po…
Browse files Browse the repository at this point in the history
…licy` (#6911)

Fixes #6908
  • Loading branch information
mbfrahry authored May 13, 2020
1 parent f91f3b0 commit a3132c0
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ func expandMonitorDiagnosticsSettingsMetrics(input []interface{}) []insights.Met

policiesRaw := v["retention_policy"].([]interface{})
var retentionPolicy *insights.RetentionPolicy
if policiesRaw != nil {
if len(policiesRaw) > 0 && policiesRaw[0] != nil {
policyRaw := policiesRaw[0].(map[string]interface{})
retentionDays := policyRaw["days"].(int)
retentionEnabled := policyRaw["enabled"].(bool)
Expand Down

0 comments on commit a3132c0

Please sign in to comment.