Skip to content

Commit

Permalink
Merge pull request #722 from fluxcd/fix-bitbucket-panic
Browse files Browse the repository at this point in the history
Fix BitBucket status update panic
  • Loading branch information
stefanprodan authored Jan 30, 2024
2 parents 681ad49 + 32c59b2 commit 333e6c3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/notifier/bitbucketserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,10 +192,10 @@ func (b BitbucketServer) duplicateBitbucketServerStatus(ctx context.Context, rev

// Make a GET call
d, err := b.Client.Do(req)
if err != nil && d.StatusCode != http.StatusNotFound {
if err != nil {
return false, fmt.Errorf("failed api call to check duplicate commit status: %w", err)
}
if isError(d) && d.StatusCode != http.StatusNotFound {
if d != nil && isError(d) && d.StatusCode != http.StatusNotFound {
defer d.Body.Close()
return false, fmt.Errorf("failed api call to check duplicate commit status: %d - %s", d.StatusCode, http.StatusText(d.StatusCode))
}
Expand Down

0 comments on commit 333e6c3

Please sign in to comment.