protect against panics in nil checks
This commit is contained in:
parent
3f8fa8ddf4
commit
f93848670e
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue