From f93848670ea0b04686e2097c0ddc189dacbcb0a7 Mon Sep 17 00:00:00 2001 From: Jake Champlin Date: Wed, 15 Mar 2017 18:21:40 -0400 Subject: [PATCH] protect against panics in nil checks --- builtin/providers/aws/resource_aws_network_acl.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/builtin/providers/aws/resource_aws_network_acl.go b/builtin/providers/aws/resource_aws_network_acl.go index 87e49db85..7a525e299 100644 --- a/builtin/providers/aws/resource_aws_network_acl.go +++ b/builtin/providers/aws/resource_aws_network_acl.go @@ -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 }