You've already forked goreleaser
mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-07-05 00:59:04 +02:00
fix: possible nil pointers on logs
refs https://github.com/goreleaser/goreleaser/pull/3966/files#r1460694856 Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
This commit is contained in:
@ -132,8 +132,11 @@ func (c *githubClient) getDefaultBranch(ctx *context.Context, repo Repo) (string
|
||||
c.checkRateLimit(ctx)
|
||||
p, res, err := c.client.Repositories.Get(ctx, repo.Owner, repo.Name)
|
||||
if err != nil {
|
||||
log.WithField("projectID", repo.String()).
|
||||
WithField("statusCode", res.StatusCode).
|
||||
log := log.WithField("projectID", repo.String())
|
||||
if res != nil {
|
||||
log = log.WithField("statusCode", res.StatusCode)
|
||||
}
|
||||
log.
|
||||
WithError(err).
|
||||
Warn("error checking for default branch")
|
||||
return "", err
|
||||
|
Reference in New Issue
Block a user