Skip to content

Commit

Permalink
Merge pull request #852 from imjaroiswebdev/issue-844-prov-crash
Browse files Browse the repository at this point in the history
Address: Pagerduty Provider Plugin Crashed
  • Loading branch information
imjaroiswebdev authored Apr 10, 2024
2 parents f5e1159 + d0af611 commit cf48216
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pagerduty/resource_pagerduty_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -769,8 +769,15 @@ func flattenIncidentUrgencyRule(v *pagerduty.IncidentUrgencyRule) []interface{}
}

func expandIncidentUrgencyType(v interface{}) *pagerduty.IncidentUrgencyType {
riut := v.([]interface{})[0].(map[string]interface{})
incidentUrgencyType := &pagerduty.IncidentUrgencyType{}
riut := make(map[string]interface{})

data, ok := v.([]interface{})
if ok && len(data) > 0 && !isNilFunc(data[0]) {
riut = data[0].(map[string]interface{})
} else {
return incidentUrgencyType
}

if v, ok := riut["type"]; ok {
incidentUrgencyType.Type = v.(string)
Expand Down

0 comments on commit cf48216

Please sign in to comment.