Skip to content

Commit

Permalink
Fix wrong milestone in webhook message (#11596) (#11612)
Browse files Browse the repository at this point in the history
Backport of #11596

Signed-off-by: Gary Kim <[email protected]>
  • Loading branch information
gary-kim authored May 24, 2020
1 parent b52e8de commit a854846
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion models/issue.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit a854846

Please sign in to comment.