diff --git a/services/pull/review.go b/services/pull/review.go index 25e0ca858a..5a77a4da16 100644 --- a/services/pull/review.go +++ b/services/pull/review.go @@ -29,7 +29,7 @@ func CreateCodeComment(doer *models.User, gitRepo *git.Repository, issue *models // - Comments that are part of a review // - Comments that reply to an existing review - if !isReview { + if !isReview && replyReviewID != 0 { // It's not part of a review; maybe a reply to a review comment or a single comment. // Check if there are reviews for that line already; if there are, this is a reply if existsReview, err = models.ReviewExists(issue, treePath, line); err != nil { diff --git a/templates/repo/diff/box.tmpl b/templates/repo/diff/box.tmpl index b6d1fdf3a0..1f4484fb11 100644 --- a/templates/repo/diff/box.tmpl +++ b/templates/repo/diff/box.tmpl @@ -149,7 +149,10 @@ {{if gt (len $line.Comments) 0}} {{$resolved := (index $line.Comments 0).IsResolved}} {{$resolveDoer := (index $line.Comments 0).ResolveDoer}} - {{$isNotPending := (not (eq (index $line.Comments 0).Review.Type 0))}} + {{$isNotPending := false}} + {{if (index $line.Comments 0).Review}} + {{$isNotPending = (not (eq (index $line.Comments 0).Review.Type 0))}} + {{end}}