mirror of
https://github.com/letic/terraform-provider-google.git
synced 2024-07-03 08:42:39 +00:00
fix possible error from nil check (#1942)
This commit is contained in:
parent
7e82a982e4
commit
83406c3c5f
|
@ -1379,7 +1379,7 @@ func resourceComputeInstanceUpdate(d *schema.ResourceData, meta interface{}) err
|
|||
if d.HasChange("service_account.0.email") || scopesChange {
|
||||
sa := d.Get("service_account").([]interface{})
|
||||
req := &compute.InstancesSetServiceAccountRequest{ForceSendFields: []string{"email"}}
|
||||
if len(sa) > 0 {
|
||||
if len(sa) > 0 && sa[0] != nil {
|
||||
saMap := sa[0].(map[string]interface{})
|
||||
req.Email = saMap["email"].(string)
|
||||
req.Scopes = canonicalizeServiceScopes(convertStringSet(saMap["scopes"].(*schema.Set)))
|
||||
|
|
Loading…
Reference in New Issue
Block a user