Skip to content

Commit

Permalink
fix nil insert
Browse files Browse the repository at this point in the history
  • Loading branch information
6543 committed Apr 19, 2020
1 parent 1ca489d commit 3e16f78
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions models/review.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
}

Expand Down

0 comments on commit 3e16f78

Please sign in to comment.