From aceed9a88f6876ef82263906443003aeb0f5ec59 Mon Sep 17 00:00:00 2001 From: Adam Kafka Date: Wed, 20 Dec 2023 15:36:17 -0800 Subject: [PATCH] Update github_client.go Add missing fix for github_client --- server/events/vcs/github_client.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/events/vcs/github_client.go b/server/events/vcs/github_client.go index 11b4d613d0..5a5a9d6b20 100644 --- a/server/events/vcs/github_client.go +++ b/server/events/vcs/github_client.go @@ -611,7 +611,9 @@ func (g *GithubClient) MergePull(pull models.PullRequest, _ models.PullRequestOp // Users can set their repo to disallow certain types of merging. // We detect which types aren't allowed and use the type that is. repo, resp, err := g.client.Repositories.Get(g.ctx, pull.BaseRepo.Owner, pull.BaseRepo.Name) - g.logger.Debug("GET /repos/%v/%v returned: %v", pull.BaseRepo.Owner, pull.BaseRepo.Name, resp.StatusCode) + if resp != nil { + g.logger.Debug("GET /repos/%v/%v returned: %v", pull.BaseRepo.Owner, pull.BaseRepo.Name, resp.StatusCode) + } if err != nil { return errors.Wrap(err, "fetching repo info") }