Skip to content

Commit

Permalink
Update threshold_profile.go
Browse files Browse the repository at this point in the history
null check added
  • Loading branch information
anita-mithran authored Jun 10, 2024
1 parent f3b1bea commit 94dab80
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions site24x7/threshold_profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -565,8 +565,12 @@ func setCronResourceData(d *schema.ResourceData, thresholdProfile *api.Threshold
d.Set("cron_no_run_alert", cronNoRunAlertMap)

cronDurationAlertMap := make(map[string]interface{})
cronDurationAlertMap["trouble"] = int(thresholdProfile.CronDurationAlert["trouble"].(float64))
d.Set("cron_duration_alert", cronDurationAlertMap)
if thresholdProfile.CronDurationAlert["trouble"] == nil {
d.Set("cron_duration_alert", cronDurationAlertMap)
} else {
cronDurationAlertMap["trouble"] = int(thresholdProfile.CronDurationAlert["trouble"].(float64))
d.Set("cron_duration_alert", cronDurationAlertMap)
}
}

func setHeartBeatAttributes(d *schema.ResourceData, thresholdProfile *api.ThresholdProfile) {
Expand Down

0 comments on commit 94dab80

Please sign in to comment.