Skip to content

Commit e354d24

Browse files
committed
change public ip util to avoid NPE
1 parent 395720c commit e354d24

File tree

1 file changed

+2
-2
lines changed
  • internal/pkg/services/iaas/utils

1 file changed

+2
-2
lines changed

internal/pkg/services/iaas/utils/utils.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ func GetPublicIP(ctx context.Context, apiClient IaaSClient, projectId, publicIpI
2323
return "", "", fmt.Errorf("get public ip: %w", err)
2424
}
2525
associatedResourceId := ""
26-
if resp.GetNetworkInterface() != nil {
27-
associatedResourceId = *resp.GetNetworkInterface()
26+
if resp.NetworkInterface != nil {
27+
associatedResourceId = *resp.NetworkInterface.Get()
2828
}
2929
return *resp.Ip, associatedResourceId, nil
3030
}

0 commit comments

Comments
 (0)