Skip to content

Commit

Permalink
fix nil port error with FromPort and ToPort for aws provider (GoogleC…
Browse files Browse the repository at this point in the history
  • Loading branch information
Elliott-weeks authored Oct 25, 2022
1 parent dd62f41 commit af6a8da
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions providers/aws/sg.go
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ func fromPort(ip types.IpPermission) int {
switch {
case *ip.IpProtocol == "icmp":
return -1
case *ip.FromPort > 0:
case ip.FromPort != nil && *ip.FromPort > 0:
return int(*ip.FromPort)
default:
return 0
Expand All @@ -370,7 +370,7 @@ func toPort(ip types.IpPermission) int {
switch {
case *ip.IpProtocol == "icmp":
return -1
case *ip.ToPort > 0:
case ip.ToPort != nil && *ip.ToPort > 0:
return int(*ip.ToPort)
default:
return 65536
Expand Down

0 comments on commit af6a8da

Please sign in to comment.