azure builder: avoid a panic in getObjectIdFromToken

This commit is contained in:
Adrien Delorme 2019-08-29 10:34:59 +02:00
parent 4b1c766c76
commit f11341c0b4
1 changed files with 2 additions and 1 deletions

View File

@ -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 {