mirror of
https://github.com/go-gitea/gitea
synced 2024-11-14 22:11:32 +01:00
Fix Null Pointer error for CommitStatusesHideActionsURL (#31731)
Fix https://github.com/go-gitea/gitea/pull/30156#discussion_r1695247028 Forgot fixing it in #31719
This commit is contained in:
parent
f989f46438
commit
0a11bce87f
1 changed files with 4 additions and 0 deletions
|
@ -541,6 +541,10 @@ func ConvertFromGitCommit(ctx context.Context, commits []*git.Commit, repo *repo
|
||||||
func CommitStatusesHideActionsURL(ctx context.Context, statuses []*CommitStatus) {
|
func CommitStatusesHideActionsURL(ctx context.Context, statuses []*CommitStatus) {
|
||||||
idToRepos := make(map[int64]*repo_model.Repository)
|
idToRepos := make(map[int64]*repo_model.Repository)
|
||||||
for _, status := range statuses {
|
for _, status := range statuses {
|
||||||
|
if status == nil {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
if status.Repo == nil {
|
if status.Repo == nil {
|
||||||
status.Repo = idToRepos[status.RepoID]
|
status.Repo = idToRepos[status.RepoID]
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue