From 5dd4613f920e1d44eb00c2eda8cc02f938d0c9bc Mon Sep 17 00:00:00 2001 From: Adam Kafka Date: Wed, 20 Dec 2023 15:36:54 -0800 Subject: [PATCH] Update gitlab_client.go Add missing fix for gitlab_client --- server/events/vcs/gitlab_client.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/events/vcs/gitlab_client.go b/server/events/vcs/gitlab_client.go index 3ce4aba6b7..60ef6bd1f2 100644 --- a/server/events/vcs/gitlab_client.go +++ b/server/events/vcs/gitlab_client.go @@ -194,7 +194,9 @@ func (g *GitlabClient) CreateComment(repo models.Repo, pullNum int, comment stri // ReactToComment adds a reaction to a comment. func (g *GitlabClient) ReactToComment(repo models.Repo, pullNum int, commentID int64, reaction string) error { _, resp, err := g.Client.AwardEmoji.CreateMergeRequestAwardEmojiOnNote(repo.FullName, pullNum, int(commentID), &gitlab.CreateAwardEmojiOptions{Name: reaction}) - g.logger.Debug("POST /projects/%s/merge_requests/%d/notes/%d/award_emoji returned: %d", repo.FullName, pullNum, commentID, resp.StatusCode) + if resp != nil { + g.logger.Debug("POST /projects/%s/merge_requests/%d/notes/%d/award_emoji returned: %d", repo.FullName, pullNum, commentID, resp.StatusCode) + } return err }