From 1956062791dae3e66c0c11d6fa86c59b031e51ee Mon Sep 17 00:00:00 2001 From: John Olheiser Date: Thu, 27 Feb 2020 03:03:32 +0000 Subject: [PATCH] Fix PR head nil panic (#7) Fix PR head nil panic Signed-off-by: jolheiser Co-authored-by: jolheiser Reviewed-on: https://gitea.com/jolheiser/sip/pulls/7 --- cmd/pulls_status.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmd/pulls_status.go b/cmd/pulls_status.go index b4348b1..64b78a8 100644 --- a/cmd/pulls_status.go +++ b/cmd/pulls_status.go @@ -27,6 +27,9 @@ func doPullStatus(ctx *cli.Context) error { var pr *gitea.PullRequest for _, pull := range pulls { + if pull.Head == nil { + continue + } compare := fmt.Sprintf("%s:%s", pull.Head.Repository.Owner.UserName, pull.Head.Name) if compare == head { pr = pull