Skip to content

Commit

Permalink
Fix NPE
Browse files Browse the repository at this point in the history
  • Loading branch information
Mattes83 committed Jun 27, 2024
1 parent 7b071a5 commit 7fe5b8a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,11 @@ func (a *IONOSClient) convertServerToInstanceMetadata(ctx context.Context, serve
klog.Infof("Found %v nics", len(*server.Entities.Nics.Items))
for _, nic := range *server.Entities.Nics.Items {
ips := *nic.Properties.Ips
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)
nicName := "unknown"
if nic.Properties.Name != nil {
nicName = *nic.Properties.Name
}
klog.Infof("Found %v ips for nic %s. Only using the first one as the remaining ones are failover ips", len(ips), nicName)
if len(ips) > 0 {
ipStr := ips[0]
ip := net.ParseIP(ipStr)
Expand Down

0 comments on commit 7fe5b8a

Please sign in to comment.