1
0
mirror of https://gitea.com/jolheiser/sip synced 2024-11-22 19:51:58 +01:00

Fix PR head nil panic (#7)

Fix PR head nil panic

Signed-off-by: jolheiser <john.olheiser@gmail.com>

Co-authored-by: jolheiser <john.olheiser@gmail.com>
Reviewed-on: https://gitea.com/jolheiser/sip/pulls/7
This commit is contained in:
John Olheiser 2020-02-27 03:03:32 +00:00
parent bb773780df
commit 1956062791

@ -27,6 +27,9 @@ func doPullStatus(ctx *cli.Context) error {
var pr *gitea.PullRequest var pr *gitea.PullRequest
for _, pull := range pulls { for _, pull := range pulls {
if pull.Head == nil {
continue
}
compare := fmt.Sprintf("%s:%s", pull.Head.Repository.Owner.UserName, pull.Head.Name) compare := fmt.Sprintf("%s:%s", pull.Head.Repository.Owner.UserName, pull.Head.Name)
if compare == head { if compare == head {
pr = pull pr = pull