Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

azurerm_api_management_backend: fix dereference pointer may cause panic #23219

Merged
merged 2 commits into from
Sep 11, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 {
if input == nil || *input == nil {
tombuildsstuff marked this conversation as resolved.
Show resolved Hide resolved
return results
}
for k, v := range input {
for k, v := range *input {
results[k] = strings.Join(v, ",")
}
return results
Expand Down