Skip to content

Commit 49eb831

Browse files
yp05327earl-warren
authored andcommitted
Fix Null Pointer error for CommitStatusesHideActionsURL (#31731)
Fix go-gitea/gitea#30156 (comment) Forgot fixing it in #31719 (cherry picked from commit 0a11bce87f07233d5f02554b8f3b4a2aabd37769)
1 parent 43b184c commit 49eb831

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

models/git/commit_status.go

+4
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,10 @@ func ConvertFromGitCommit(ctx context.Context, commits []*git.Commit, repo *repo
506506
func CommitStatusesHideActionsURL(ctx context.Context, statuses []*CommitStatus) {
507507
idToRepos := make(map[int64]*repo_model.Repository)
508508
for _, status := range statuses {
509+
if status == nil {
510+
continue
511+
}
512+
509513
if status.Repo == nil {
510514
status.Repo = idToRepos[status.RepoID]
511515
}

0 commit comments

Comments
 (0)