Skip to content

Commit

Permalink
Don't panic with nil tracking response body (#192)
Browse files Browse the repository at this point in the history
  • Loading branch information
dbolson authored Apr 19, 2024
1 parent 476f8c6 commit 7710b33
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
8 changes: 5 additions & 3 deletions internal/analytics/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,13 @@ func (c *Client) SendEvent(
if err != nil { //nolint:staticcheck
// TODO: log error
}
if resp != nil {
resp.Body.Close()
if resp == nil {
c.wg.Done()
return
}
resp.Body.Close()

_, err := io.ReadAll(resp.Body)
_, err = io.ReadAll(resp.Body)
if err != nil { //nolint:staticcheck
// TODO: log error
}
Expand Down
3 changes: 0 additions & 3 deletions internal/quickstart/messages.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,9 +231,6 @@ func fetchFlagStatus(
}
}

// noInstructionsMsg is sent when we can't find the SDK instructions repository for the given SDK.
type noInstructionsMsg struct{}

type selectedSDKMsg struct {
index int
}
Expand Down

0 comments on commit 7710b33

Please sign in to comment.