Skip to content

Commit 333e6c3

Browse files
authored
Merge pull request #722 from fluxcd/fix-bitbucket-panic
Fix BitBucket status update panic
2 parents 681ad49 + 32c59b2 commit 333e6c3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

internal/notifier/bitbucketserver.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,10 +192,10 @@ func (b BitbucketServer) duplicateBitbucketServerStatus(ctx context.Context, rev
192192

193193
// Make a GET call
194194
d, err := b.Client.Do(req)
195-
if err != nil && d.StatusCode != http.StatusNotFound {
195+
if err != nil {
196196
return false, fmt.Errorf("failed api call to check duplicate commit status: %w", err)
197197
}
198-
if isError(d) && d.StatusCode != http.StatusNotFound {
198+
if d != nil && isError(d) && d.StatusCode != http.StatusNotFound {
199199
defer d.Body.Close()
200200
return false, fmt.Errorf("failed api call to check duplicate commit status: %d - %s", d.StatusCode, http.StatusText(d.StatusCode))
201201
}

0 commit comments

Comments
 (0)