summaryrefslogtreecommitdiffstats
path: root/services/convert/pull_review.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2024-03-14 03:46:15 +0800
committerGitHub <noreply@github.com>2024-03-13 19:46:15 +0000
commit83ba882bab7e1545fe02cd41f554ae41b83a6040 (patch)
tree7607028e29e6b33cbbf5ae897f743ba4a56008fc /services/convert/pull_review.go
parent712e19fa6fbf2f1a5b0a471782d38a7d91e538ae (diff)
downloadgitea-83ba882bab7e1545fe02cd41f554ae41b83a6040.tar.gz
gitea-83ba882bab7e1545fe02cd41f554ae41b83a6040.zip
Fix possible NPE in ToPullReviewList (#29759)
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Diffstat (limited to 'services/convert/pull_review.go')
-rw-r--r--services/convert/pull_review.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/services/convert/pull_review.go b/services/convert/pull_review.go
index aa7ad68a47..29a5ab7466 100644
--- a/services/convert/pull_review.go
+++ b/services/convert/pull_review.go
@@ -66,7 +66,7 @@ func ToPullReviewList(ctx context.Context, rl []*issues_model.Review, doer *user
result := make([]*api.PullReview, 0, len(rl))
for i := range rl {
// show pending reviews only for the user who created them
- if rl[i].Type == issues_model.ReviewTypePending && !(doer.IsAdmin || doer.ID == rl[i].ReviewerID) {
+ if rl[i].Type == issues_model.ReviewTypePending && (doer == nil || (!doer.IsAdmin && doer.ID != rl[i].ReviewerID)) {
continue
}
r, err := ToPullReview(ctx, rl[i], doer)