Skip to content
This repository was archived by the owner on Nov 12, 2025. It is now read-only.

Commit c256f49

Browse files
authored
Merge pull request #38 from GDATASoftwareAG/npe
Fix nil pointer deref
2 parents 0f5b298 + 44b9026 commit c256f49

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

internal/ionos/apiclient.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,9 @@ func (c *APIClient) PatchLoadBalancerForwardingRule(ctx context.Context, datacen
148148
func (c *APIClient) CreateServer(ctx context.Context, datacenterId string, server ionoscloud.Server) (ionoscloud.Server, *ionoscloud.APIResponse, error) {
149149
serverReq := c.client.ServersApi.DatacentersServersPost(ctx, datacenterId)
150150
server, response, err := serverReq.Server(server).Execute()
151-
server.Id = ionoscloud.ToPtr(fmt.Sprintf("ionos://%s", *server.Id))
151+
if server.Id != nil {
152+
server.Id = ionoscloud.ToPtr(fmt.Sprintf("ionos://%s", *server.Id))
153+
}
152154
return server, response, err
153155
}
154156

0 commit comments

Comments
 (0)