protect against panics in nil checks

This commit is contained in:
Jake Champlin 2017-03-15 18:21:40 -04:00
parent 3f8fa8ddf4
commit f93848670e
No known key found for this signature in database
GPG Key ID: DC31F41958EF4AC2
1 changed files with 3 additions and 3 deletions

View File

@ -397,7 +397,7 @@ func updateNetworkAclEntries(d *schema.ResourceData, entryType string, conn *ec2
}
}
if *add.CidrBlock != "" {
if add.CidrBlock != nil && *add.CidrBlock != "" {
// AWS mutates the CIDR block into a network implied by the IP and
// mask provided. This results in hashing inconsistencies between
// the local config file and the state returned by the API. Error
@ -417,11 +417,11 @@ func updateNetworkAclEntries(d *schema.ResourceData, entryType string, conn *ec2
IcmpTypeCode: add.IcmpTypeCode,
}
if *add.CidrBlock != "" {
if add.CidrBlock != nil && *add.CidrBlock != "" {
createOpts.CidrBlock = add.CidrBlock
}
if *add.Ipv6CidrBlock != "" {
if add.Ipv6CidrBlock != nil && *add.Ipv6CidrBlock != "" {
createOpts.Ipv6CidrBlock = add.Ipv6CidrBlock
}