Skip to content
This repository has been archived by the owner on Apr 7, 2020. It is now read-only.

Commit

Permalink
Prevent nil pointer panic in Alicloud infra controller
Browse files Browse the repository at this point in the history
```improvement user
An issue in the Alicloud infrastructure controller that might cause nil pointer panics has been fixed.
```
  • Loading branch information
rfranzke committed May 31, 2019
1 parent 20af1d2 commit 4f11f22
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,13 @@ func FetchEIPInternetChargeType(vpcClient alicloudclient.VPC, vpcID string) (str
if err != nil {
return "", err
}
natGateway := describeNatGatewaysRes.NatGateways.NatGateway[0]

if len(describeNatGatewaysRes.NatGateways.NatGateway) != 1 {
return alicloudclient.DefaultInternetChargeType, nil
}

natGateway := describeNatGatewaysRes.NatGateways.NatGateway[0]

if len(natGateway.IpLists.IpList) == 0 {
return alicloudclient.DefaultInternetChargeType, nil
}
Expand Down

0 comments on commit 4f11f22

Please sign in to comment.