Skip to content

Commit

Permalink
fix: nil pointer on download error (#12)
Browse files Browse the repository at this point in the history
Signed-off-by: Mathew Wicks <thesuperzapper@users.noreply.github.com>
  • Loading branch information
thesuperzapper committed Aug 9, 2023
1 parent ce4335c commit 243937f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/generate/source.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ func (h *SourceHelper) getReleaseByVersion(version string) (*github.RepositoryRe

release, resp, err := client.Repositories.GetReleaseByTag(context.Background(), h.GithubOwner, h.GithubRepo, tagName)
if err != nil {
if resp.StatusCode == http.StatusNotFound {
if resp != nil && resp.StatusCode == http.StatusNotFound {
return nil, fmt.Errorf("no github release found with tag '%s'", tagName)
}
return nil, err
Expand Down

0 comments on commit 243937f

Please sign in to comment.