summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--models/review.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/models/review.go b/models/review.go
index 7f23777c3e..bbd4983fc2 100644
--- a/models/review.go
+++ b/models/review.go
@@ -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
+ }
}
}