1
0
mirror of https://github.com/go-gitea/gitea.git synced 2024-11-04 08:17:24 -05:00

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

This commit is contained in:
6543 2020-04-20 05:04:08 +02:00 committed by GitHub
parent e37e217602
commit 77171abcad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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