Merge pull request #18 from LefsFlarey/issue/3675

Fix 500 error caused by deleted users on issues (#3675)
pull/46/merge
Lunny Xiao 8 years ago committed by GitHub
commit c511f1c6c3
  1. 8
      models/issue.go

@ -94,12 +94,12 @@ func (issue *Issue) loadAttributes(e Engine) (err error) {
if issue.Poster == nil {
issue.Poster, err = getUserByID(e, issue.PosterID)
if err != nil {
if IsErrUserNotExist(err) {
issue.PosterID = -1
issue.Poster = NewGhostUser()
} else {
issue.PosterID = -1
issue.Poster = NewGhostUser()
if !IsErrUserNotExist(err) {
return fmt.Errorf("getUserByID.(poster) [%d]: %v", issue.PosterID, err)
}
err = nil
return
}
}

Loading…
Cancel
Save