mirror of
https://github.com/go-gitea/gitea.git
synced 2024-12-04 14:46:57 -05:00
Prevent xorm nil insert in Review.Comments (#11150)
This commit is contained in:
parent
e37e217602
commit
77171abcad
@ -457,8 +457,10 @@ func InsertReviews(reviews []*Review) error {
|
|||||||
c.ReviewID = review.ID
|
c.ReviewID = review.ID
|
||||||
}
|
}
|
||||||
|
|
||||||
if _, err := sess.NoAutoTime().Insert(review.Comments); err != nil {
|
if len(review.Comments) > 0 {
|
||||||
return err
|
if _, err := sess.NoAutoTime().Insert(review.Comments); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user