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

tokarchuk/v1.17
6543 5 years ago committed by GitHub
parent e37e217602
commit 77171abcad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      models/review.go

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

Loading…
Cancel
Save