From 16652ed26a17e50936bb42d456089a5514ffda87 Mon Sep 17 00:00:00 2001 From: Alexandr Hacicheant Date: Fri, 13 Sep 2024 22:42:58 +0300 Subject: [PATCH] Fixed possible `nil` pointer dereference Signed-off-by: Alexandr Hacicheant --- internal/desktop/client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/desktop/client.go b/internal/desktop/client.go index 77836e227..4f8c54770 100644 --- a/internal/desktop/client.go +++ b/internal/desktop/client.go @@ -166,10 +166,10 @@ type CreateFileShareResponse struct { func (c *Client) CreateFileShare(ctx context.Context, r CreateFileShareRequest) (*CreateFileShareResponse, error) { rawBody, _ := json.Marshal(r) req, err := http.NewRequestWithContext(ctx, http.MethodPost, backendURL("/mutagen/file-shares"), bytes.NewReader(rawBody)) - req.Header.Set("Content-Type", "application/json") if err != nil { return nil, err } + req.Header.Set("Content-Type", "application/json") resp, err := c.client.Do(req) if err != nil { return nil, err