Skip to content

Commit 9655e8a

Browse files
authored
Merge pull request #38 from GDATASoftwareAG/NPE
Fix NPE
2 parents 7b071a5 + 7fe5b8a commit 9655e8a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pkg/client/client.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,11 @@ func (a *IONOSClient) convertServerToInstanceMetadata(ctx context.Context, serve
9696
klog.Infof("Found %v nics", len(*server.Entities.Nics.Items))
9797
for _, nic := range *server.Entities.Nics.Items {
9898
ips := *nic.Properties.Ips
99-
klog.Infof("Found %v ips for nic %s. Only using the first one as the remaining ones are failover ips", len(ips), *nic.Properties.Name)
99+
nicName := "unknown"
100+
if nic.Properties.Name != nil {
101+
nicName = *nic.Properties.Name
102+
}
103+
klog.Infof("Found %v ips for nic %s. Only using the first one as the remaining ones are failover ips", len(ips), nicName)
100104
if len(ips) > 0 {
101105
ipStr := ips[0]
102106
ip := net.ParseIP(ipStr)

0 commit comments

Comments
 (0)