Browse Source

Prevent xorm nil insert in Review.Comments (#11150)

for-closed-social
6543 4 years ago
committed by GitHub
parent
commit
77171abcad
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions
  1. +4
    -2
      models/review.go

+ 4
- 2
models/review.go View File

@ -457,8 +457,10 @@ func InsertReviews(reviews []*Review) error {
c.ReviewID = review.ID
}
if _, err := sess.NoAutoTime().Insert(review.Comments); err != nil {
return err
if len(review.Comments) > 0 {
if _, err := sess.NoAutoTime().Insert(review.Comments); err != nil {
return err
}
}
}

Loading…
Cancel
Save