1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-13 22:17:20 +00:00

Fix panic when comment is nil (#34257)

Fix #34254
This commit is contained in:
Lunny Xiao
2025-04-23 18:58:00 -07:00
committed by GitHub
parent e625250ffc
commit e73c1139ac
3 changed files with 10 additions and 22 deletions

View File

@ -145,6 +145,9 @@ func PullRequestCodeOwnersReviewSpecialCommits(ctx context.Context, pr *issues_m
log.Warn("Failed add assignee user: %s to PR review: %s#%d, error: %s", u.Name, pr.BaseRepo.Name, pr.ID, err)
return nil, err
}
if comment == nil { // comment maybe nil if review type is ReviewTypeRequest
continue
}
notifiers = append(notifiers, &ReviewRequestNotifier{
Comment: comment,
IsAdd: true,
@ -158,6 +161,9 @@ func PullRequestCodeOwnersReviewSpecialCommits(ctx context.Context, pr *issues_m
log.Warn("Failed add assignee team: %s to PR review: %s#%d, error: %s", t.Name, pr.BaseRepo.Name, pr.ID, err)
return nil, err
}
if comment == nil { // comment maybe nil if review type is ReviewTypeRequest
continue
}
notifiers = append(notifiers, &ReviewRequestNotifier{
Comment: comment,
IsAdd: true,