Skip to content

Commit

Permalink
Merge pull request #23219 from wuxu92/fix/apimpanic
Browse files Browse the repository at this point in the history
`azurerm_api_management_backend`: fix dereference pointer may cause panic
  • Loading branch information
tombuildsstuff authored Sep 11, 2023
2 parents 2e10b8a + b5a8569 commit 999c27f
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -540,17 +540,17 @@ func flattenApiManagementBackendCredentials(input *backend.BackendCredentialsCon
if input.Certificate != nil {
result["certificate"] = *input.Certificate
}
result["header"] = flattenApiManagementBackendCredentialsObject(*input.Header)
result["query"] = flattenApiManagementBackendCredentialsObject(*input.Query)
result["header"] = flattenApiManagementBackendCredentialsObject(input.Header)
result["query"] = flattenApiManagementBackendCredentialsObject(input.Query)
return append(results, result)
}

func flattenApiManagementBackendCredentialsObject(input map[string][]string) map[string]interface{} {
func flattenApiManagementBackendCredentialsObject(input *map[string][]string) map[string]interface{} {
results := make(map[string]interface{})
if input == nil {
return results
}
for k, v := range input {
for k, v := range *input {
results[k] = strings.Join(v, ",")
}
return results
Expand Down

0 comments on commit 999c27f

Please sign in to comment.