Skip to content

Commit

Permalink
prevent a nil deref when client gets a nil response from an unavailab…
Browse files Browse the repository at this point in the history
…le cluster
  • Loading branch information
wandergeek committed Aug 15, 2023
1 parent b3a45b1 commit 04d257c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/clients/kibana/slo.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ func GetSlo(ctx context.Context, apiClient *clients.ApiClient, id, spaceID strin
ctxWithAuth := apiClient.SetSloAuthContext(ctx)
req := client.GetSloOp(ctxWithAuth, "default", id).KbnXsrf("true")
sloRes, res, err := req.Execute()
if err != nil && res == nil {
return nil, diag.FromErr(err)
}
if res.StatusCode == http.StatusNotFound {
return nil, nil
}
Expand Down

0 comments on commit 04d257c

Please sign in to comment.