Fix nil pointer error on received check_run event (#331)

* Reproduce nil pointer error on received check_run event

* Fix nil pointer error on received check_run event
This commit is contained in:
Hidetake Iwata
2021-02-18 20:22:36 +09:00
committed by GitHub
parent cfbaad38c8
commit 1ddcf6946a
3 changed files with 386 additions and 14 deletions
@@ -146,8 +146,8 @@ func (autoscaler *HorizontalRunnerAutoscalerGitHubWebhook) Handle(w http.Respons
case *gogithub.CheckRunEvent:
target, err = autoscaler.getScaleUpTarget(
context.TODO(),
*e.Repo.Name,
*e.Org.Name,
e.GetRepo().GetName(),
e.GetOrg().GetLogin(), // empty string if the repo is not in an organization
autoscaler.MatchCheckRunEvent(e),
)
case *gogithub.PingEvent: