Fix Null Pointer error for CommitStatusesHideActionsURL (#31731)

Fix https://github.com/go-gitea/gitea/pull/30156#discussion_r1695247028

Forgot fixing it in #31719
pull/31732/head^2
yp05327 4 months ago committed by GitHub
parent f989f46438
commit 0a11bce87f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 4
      models/git/commit_status.go

@ -541,6 +541,10 @@ func ConvertFromGitCommit(ctx context.Context, commits []*git.Commit, repo *repo
func CommitStatusesHideActionsURL(ctx context.Context, statuses []*CommitStatus) {
idToRepos := make(map[int64]*repo_model.Repository)
for _, status := range statuses {
if status == nil {
continue
}
if status.Repo == nil {
status.Repo = idToRepos[status.RepoID]
}

Loading…
Cancel
Save