Skip to content

Commit

Permalink
fix(github): check githubResponse and body
Browse files Browse the repository at this point in the history
  • Loading branch information
EtienneM committed Aug 29, 2022
1 parent 3d67052 commit e802c34
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion services/github/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ func NewClient() Client {

func (c client) GetLatestRelease(ctx context.Context) (*github.RepositoryRelease, error) {
latestRelease, githubResponse, err := c.githubRepositoriesService.GetLatestRelease(ctx, "Scalingo", "cli")
defer githubResponse.Body.Close()
if githubResponse != nil && githubResponse.Body != nil {
defer githubResponse.Body.Close()
}

debug.Printf("GitHub response: %#v\n", githubResponse)

Expand Down

0 comments on commit e802c34

Please sign in to comment.