Skip to content

Commit

Permalink
Cater for nil OptionalClaims in Application
Browse files Browse the repository at this point in the history
  • Loading branch information
manicminer committed Jun 4, 2020
1 parent bf8694a commit 4e9744b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion azuread/resource_application.go
Original file line number Diff line number Diff line change
Expand Up @@ -745,6 +745,12 @@ func expandADApplicationOptionalClaim(in []interface{}) *[]graphrbac.OptionalCla
}

func flattenADApplicationOptionalClaims(in *graphrbac.OptionalClaims) interface{} {
var result []map[string]interface{}

if in == nil {
return result
}

optionalClaims := make(map[string]interface{})
if claims := flattenADApplicationOptionalClaimsList(in.AccessToken); len(claims) > 0 {
optionalClaims["access_token"] = claims
Expand All @@ -756,7 +762,6 @@ func flattenADApplicationOptionalClaims(in *graphrbac.OptionalClaims) interface{
//if claims := flattenADApplicationOptionalClaimsList(in.SamlToken); len(claims) > 0 {
// optionalClaims["saml_token"] = claims
//}
var result []map[string]interface{}
if len(optionalClaims) == 0 {
return result
}
Expand Down

0 comments on commit 4e9744b

Please sign in to comment.