Skip to content

Commit 73a7045

Browse files
Bowei Wangsrinioci
authored andcommitted
Bug Fix, Check if the IP address in Nil before dereferencing it to avoid Nil pointer causing terraform to crash
1 parent 4e7ed9c commit 73a7045

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

internal/service/load_balancer/load_balancer_load_balancer_resource.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -622,10 +622,10 @@ func (s *LoadBalancerLoadBalancerResourceCrud) SetData() error {
622622
for _, ad := range s.Res.IpAddresses {
623623
if ad.IpAddress != nil {
624624
ipAddresses = append(ipAddresses, *ad.IpAddress)
625-
}
626-
tmp := *ad.IpAddress
627-
if !isIPV4(tmp) {
628-
ipMode = "IPV6"
625+
tmp := *ad.IpAddress
626+
if !isIPV4(tmp) {
627+
ipMode = "IPV6"
628+
}
629629
}
630630
}
631631
s.D.Set("ip_mode", ipMode)

0 commit comments

Comments
 (0)