Skip to content

Commit

Permalink
Merge pull request #2215 from hashicorp/b-route-cidr-block-optional
Browse files Browse the repository at this point in the history
provider/aws: fix panic when route has no cidr_block
  • Loading branch information
phinze committed Jun 3, 2015
2 parents 300839d + 1caef30 commit 328db1c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion builtin/providers/aws/resource_aws_route_table.go
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,10 @@ func resourceAwsRouteTableDelete(d *schema.ResourceData, meta interface{}) error
func resourceAwsRouteTableHash(v interface{}) int {
var buf bytes.Buffer
m := v.(map[string]interface{})
buf.WriteString(fmt.Sprintf("%s-", m["cidr_block"].(string)))

if v, ok := m["cidr_block"]; ok {
buf.WriteString(fmt.Sprintf("%s-", v.(string)))
}

if v, ok := m["gateway_id"]; ok {
buf.WriteString(fmt.Sprintf("%s-", v.(string)))
Expand Down

0 comments on commit 328db1c

Please sign in to comment.