aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoryp05327 <576951401@qq.com>2024-07-30 11:56:25 +0900
committerGitHub <noreply@github.com>2024-07-30 02:56:25 +0000
commit0a11bce87f07233d5f02554b8f3b4a2aabd37769 (patch)
treedd569b9d933c22bae7cd6cba10317a3cefd1a623
parentf989f464386139592b6911cad1be4c901eb97fe5 (diff)
downloadgitea-0a11bce87f07233d5f02554b8f3b4a2aabd37769.tar.gz
gitea-0a11bce87f07233d5f02554b8f3b4a2aabd37769.zip
Fix Null Pointer error for CommitStatusesHideActionsURL (#31731)
Fix https://github.com/go-gitea/gitea/pull/30156#discussion_r1695247028 Forgot fixing it in #31719
-rw-r--r--models/git/commit_status.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/models/git/commit_status.go b/models/git/commit_status.go
index deec21e38b..0579a41209 100644
--- a/models/git/commit_status.go
+++ b/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]
}