diff --git a/models/issue.go b/models/issue.go index 04b9b3551fcb3..12b08f6d395d2 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)