mirror of
				https://codeberg.org/forgejo/forgejo.git
				synced 2025-10-31 06:21:11 +00:00 
			
		
		
		
	Prevent xorm nil insert in Review.Comments (#11150)
This commit is contained in:
		
					parent
					
						
							
								e37e217602
							
						
					
				
			
			
				commit
				
					
						77171abcad
					
				
			
		
					 1 changed files with 4 additions and 2 deletions
				
			
		|  | @ -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 | ||||
| 			} | ||||
| 		} | ||||
| 	} | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue