1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-09-16 09:26:52 +02:00

fix: if resp is nil avoid checking resp.StatusCode in Gitlab client (#1092) (#1093)

This commit is contained in:
Dinko Korunic
2019-08-01 13:26:53 +02:00
committed by Carlos Alexandro Becker
parent 8286402e3e
commit 7871c58ac2

View File

@@ -68,7 +68,7 @@ func (c *gitlabClient) CreateRelease(ctx *context.Context, body string) (release
name := title
tagName := ctx.Git.CurrentTag
release, resp, err := c.client.Releases.GetRelease(projectID, tagName)
if err != nil && resp.StatusCode != 403 {
if err != nil && (resp == nil || resp.StatusCode != 403) {
return "", err
}