From a854846f0679766df0d8cc9e3edd3016c3a12f87 Mon Sep 17 00:00:00 2001 From: Gary Kim Date: Mon, 25 May 2020 07:03:02 +0800 Subject: [PATCH] Fix wrong milestone in webhook message (#11596) (#11612) Backport of #11596 Signed-off-by: Gary Kim --- models/issue.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/issue.go b/models/issue.go index 04b9b3551f..12b08f6d39 100644 --- a/models/issue.go +++ b/models/issue.go @@ -241,7 +241,7 @@ func (issue *Issue) loadReactions(e Engine) (err error) { } func (issue *Issue) loadMilestone(e Engine) (err error) { - if issue.Milestone == nil && issue.MilestoneID > 0 { + if (issue.Milestone == nil || issue.Milestone.ID != issue.MilestoneID) && issue.MilestoneID > 0 { issue.Milestone, err = getMilestoneByRepoID(e, issue.RepoID, issue.MilestoneID) if err != nil && !IsErrMilestoneNotExist(err) { return fmt.Errorf("getMilestoneByRepoID [repo_id: %d, milestone_id: %d]: %v", issue.RepoID, issue.MilestoneID, err) -- 2.39.5