From a4f0a283a229b835c8d2d559c50b8c29ec6bd588 Mon Sep 17 00:00:00 2001 From: Peter Zeng Date: Sat, 5 Aug 2023 07:28:18 +0000 Subject: [PATCH] Fix the panic when required checks is disabled --- server/events/vcs/github_client.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/server/events/vcs/github_client.go b/server/events/vcs/github_client.go index aa64dc8cbc..5008970f96 100644 --- a/server/events/vcs/github_client.go +++ b/server/events/vcs/github_client.go @@ -418,6 +418,10 @@ func (g *GithubClient) GetCombinedStatusMinusApply(repo models.Repo, pull *githu return false, errors.Wrap(err, "getting required status checks") } + if required.RequiredStatusChecks == nil { + return true, nil + } + //check check suite/check run api checksuites, _, err := g.client.Checks.ListCheckSuitesForRef(context.Background(), *pull.Head.Repo.Owner.Login, repo.Name, *pull.Head.Ref, nil) if err != nil {