Skip to content

Commit d7a9637

Browse files
yp05327richmahn
authored andcommitted
Fix Null Pointer error for CommitStatusesHideActionsURL (#31731)
Fix go-gitea/gitea#30156 (comment) Forgot fixing it in #31719
1 parent 9e35216 commit d7a9637

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
@@ -541,6 +541,10 @@ func ConvertFromGitCommit(ctx context.Context, commits []*git.Commit, repo *repo
541541
func CommitStatusesHideActionsURL(ctx context.Context, statuses []*CommitStatus) {
542542
idToRepos := make(map[int64]*repo_model.Repository)
543543
for _, status := range statuses {
544+
if status == nil {
545+
continue
546+
}
547+
544548
if status.Repo == nil {
545549
status.Repo = idToRepos[status.RepoID]
546550
}

0 commit comments

Comments
 (0)