Skip to content

Commit

Permalink
Merge pull request #2533 from hashicorp/b-vpn-connection-protection
Browse files Browse the repository at this point in the history
provider/aws: nil protection against VPN connections [GH-2144]
  • Loading branch information
phinze committed Jun 30, 2015
2 parents 13dd7f8 + 1cc5068 commit 97ee426
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions builtin/providers/aws/resource_vpn_connection_route.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,12 @@ func resourceAwsVpnConnectionRouteRead(d *schema.ResourceData, meta interface{})
return err
}
}
if resp == nil || len(resp.VPNConnections) == 0 {
// This is kind of a weird edge case. I'd rather return an error
// instead of just blindly setting the ID to ""... since I don't know
// what might cause this.
return fmt.Errorf("No VPN connections returned")
}

vpnConnection := resp.VPNConnections[0]

Expand Down

0 comments on commit 97ee426

Please sign in to comment.