Merge pull request #8047 from hashicorp/avoid_panic_when_token_in_azure_builder
azure builder: avoid a panic in getObjectIdFromToken
This commit is contained in:
commit
c475eb57ef
|
@ -439,8 +439,9 @@ func getObjectIdFromToken(ui packer.Ui, token *adal.ServicePrincipalToken) strin
|
|||
ui.Error(fmt.Sprintf("Failed to parse the token,Error: %s", err.Error()))
|
||||
return ""
|
||||
}
|
||||
return claims["oid"].(string)
|
||||
|
||||
oid, _ := claims["oid"].(string)
|
||||
return oid
|
||||
}
|
||||
|
||||
func normalizeAzureRegion(name string) string {
|
||||
|
|
Loading…
Reference in New Issue