diff --git a/routers/web/repo/commit.go b/routers/web/repo/commit.go index 3da8b1506c..ec9e49eb9c 100644 --- a/routers/web/repo/commit.go +++ b/routers/web/repo/commit.go @@ -463,6 +463,9 @@ func processGitCommits(ctx *context.Context, gitCommits []*git.Commit) []*git_mo commits := git_model.ConvertFromGitCommit(ctx, gitCommits, ctx.Repo.Repository) if !ctx.Repo.CanRead(unit_model.TypeActions) { for _, commit := range commits { + if commit.Status == nil { + continue + } commit.Status.HideActionsURL(ctx) git_model.CommitStatusesHideActionsURL(ctx, commit.Statuses) } diff --git a/routers/web/repo/issue.go b/routers/web/repo/issue.go index b48b078736..5a0dcd830f 100644 --- a/routers/web/repo/issue.go +++ b/routers/web/repo/issue.go @@ -1784,6 +1784,9 @@ func ViewIssue(ctx *context.Context) { } if !ctx.Repo.CanRead(unit.TypeActions) { for _, commit := range comment.Commits { + if commit.Status == nil { + continue + } commit.Status.HideActionsURL(ctx) git_model.CommitStatusesHideActionsURL(ctx, commit.Statuses) }