mirror of
https://github.com/go-gitea/gitea
synced 2025-07-19 16:58:37 +00:00
Dont load Review if Comment is CommentTypeReviewRequest (#28551)
RequestReview get deleted on review. So we don't have to try to load them on comments. broken out #28544
This commit is contained in:
@@ -695,8 +695,15 @@ func (c *Comment) LoadReactions(ctx context.Context, repo *repo_model.Repository
|
||||
}
|
||||
|
||||
func (c *Comment) loadReview(ctx context.Context) (err error) {
|
||||
if c.ReviewID == 0 {
|
||||
return nil
|
||||
}
|
||||
if c.Review == nil {
|
||||
if c.Review, err = GetReviewByID(ctx, c.ReviewID); err != nil {
|
||||
// review request which has been replaced by actual reviews doesn't exist in database anymore, so ignorem them.
|
||||
if c.Type == CommentTypeReviewRequest {
|
||||
return nil
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user