Merge pull request #723 from fluxcd/backport-722-to-release/v1.2.x
[release/v1.2.x] Fix BitBucket status update panic
This commit is contained in:
commit
080cbeca42
|
@ -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))
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue