Skip to content

Commit

Permalink
Fix Null Pointer error for CommitStatusesHideActionsURL (#31731)
Browse files Browse the repository at this point in the history
Fix go-gitea/gitea#30156 (comment)

Forgot fixing it in #31719

(cherry picked from commit 0a11bce87f07233d5f02554b8f3b4a2aabd37769)
  • Loading branch information
yp05327 authored and earl-warren committed Aug 4, 2024
1 parent 43b184c commit 49eb831
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions models/git/commit_status.go
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,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]
}
Expand Down

0 comments on commit 49eb831

Please sign in to comment.