fix 500 error when view an issue which's milestone deleted (#2297) (#2299)

This commit is contained in:
Lunny Xiao 2017-08-14 10:45:06 +08:00 committed by GitHub
parent 622552b709
commit 09fff9e1c1

View File

@ -146,7 +146,7 @@ func (issue *Issue) loadAttributes(e Engine) (err error) {
if issue.Milestone == nil && issue.MilestoneID > 0 { if issue.Milestone == nil && issue.MilestoneID > 0 {
issue.Milestone, err = getMilestoneByRepoID(e, issue.RepoID, issue.MilestoneID) issue.Milestone, err = getMilestoneByRepoID(e, issue.RepoID, issue.MilestoneID)
if err != nil { if err != nil && !IsErrMilestoneNotExist(err) {
return fmt.Errorf("getMilestoneByRepoID [repo_id: %d, milestone_id: %d]: %v", issue.RepoID, issue.MilestoneID, err) return fmt.Errorf("getMilestoneByRepoID [repo_id: %d, milestone_id: %d]: %v", issue.RepoID, issue.MilestoneID, err)
} }
} }