Skip to content

Commit

Permalink
fix: check that the variable resp is not nil (#3670)
Browse files Browse the repository at this point in the history
# If applied, this commit will

Linked issues will be resolved.

# Why is this change being made?

Because the program will no longer have to refer to nil.

# Provide links to any relevant tickets, URLs or other resources
- #3669
  • Loading branch information
ddddddO committed Dec 29, 2022
1 parent 7100096 commit 3734c2d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion internal/client/github.go
Expand Up @@ -325,10 +325,14 @@ func (c *githubClient) Upload(
file,
)
if err != nil {
requestID := ""
if resp != nil {
requestID = resp.Header.Get("X-GitHub-Request-Id")
}
log.WithFields(log.Fields{
"name": artifact.Name,
"release-id": releaseID,
"request-id": resp.Header.Get("X-GitHub-Request-Id"),
"request-id": requestID,
}).Warn("upload failed")
}
if err == nil {
Expand Down

0 comments on commit 3734c2d

Please sign in to comment.