Skip to content

Commit 243937f

Browse files
fix: nil pointer on download error (#12)
Signed-off-by: Mathew Wicks <[email protected]>
1 parent ce4335c commit 243937f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

internal/generate/source.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ func (h *SourceHelper) getReleaseByVersion(version string) (*github.RepositoryRe
160160

161161
release, resp, err := client.Repositories.GetReleaseByTag(context.Background(), h.GithubOwner, h.GithubRepo, tagName)
162162
if err != nil {
163-
if resp.StatusCode == http.StatusNotFound {
163+
if resp != nil && resp.StatusCode == http.StatusNotFound {
164164
return nil, fmt.Errorf("no github release found with tag '%s'", tagName)
165165
}
166166
return nil, err

0 commit comments

Comments
 (0)