Skip to content

Commit

Permalink
Merge pull request #4697 from terraform-providers/kubernetes_cluster-…
Browse files Browse the repository at this point in the history
…nil-check

azurerm_kubernetes_cluster - prevent possible nil crashes when flattening the `service_principal_profile` property.
  • Loading branch information
tombuildsstuff authored Oct 24, 2019
2 parents 2802a11 + 4b1ceae commit 3d04663
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion azurerm/resource_arm_kubernetes_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -1641,7 +1641,7 @@ func flattenAzureRmKubernetesClusterServicePrincipalProfile(profile *containerse
val = v.List()
}

if len(val) > 0 {
if len(val) > 0 && val[0] != nil {
raw := val[0].(map[string]interface{})
clientSecret = raw["client_secret"].(string)
}
Expand Down

0 comments on commit 3d04663

Please sign in to comment.