From 75183b6013826ad7d58583cde3aae6e4988d42cb Mon Sep 17 00:00:00 2001 From: Chris Phillips Date: Tue, 13 Mar 2018 13:01:32 -0700 Subject: [PATCH] fixes nil pointer when other VPCs with peering connections are found (#27) If you have multiple VPCs in the account that also have peering connections, then the unrelated VPCs should be ignored. --- aws/vpc.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/vpc.go b/aws/vpc.go index 8db805f..f5fe377 100644 --- a/aws/vpc.go +++ b/aws/vpc.go @@ -110,6 +110,8 @@ func (v *vpcclient) DescribeVPCPeerCIDRs(vpcID string) ([]*net.IPNet, error) { peer = peering.RequesterVpcInfo } else if vpcID == *peering.RequesterVpcInfo.VpcId { peer = peering.AccepterVpcInfo + } else { + continue } for _, cidrBlock := range peer.CidrBlockSet {