Merge pull request #18 from LefsFlarey/issue/3675
Fix 500 error caused by deleted users on issues (#3675)
This commit is contained in:
commit
c511f1c6c3
1 changed files with 4 additions and 4 deletions
|
@ -94,12 +94,12 @@ func (issue *Issue) loadAttributes(e Engine) (err error) {
|
||||||
if issue.Poster == nil {
|
if issue.Poster == nil {
|
||||||
issue.Poster, err = getUserByID(e, issue.PosterID)
|
issue.Poster, err = getUserByID(e, issue.PosterID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if IsErrUserNotExist(err) {
|
|
||||||
issue.PosterID = -1
|
issue.PosterID = -1
|
||||||
issue.Poster = NewGhostUser()
|
issue.Poster = NewGhostUser()
|
||||||
} else {
|
if !IsErrUserNotExist(err) {
|
||||||
return fmt.Errorf("getUserByID.(poster) [%d]: %v", issue.PosterID, err)
|
return fmt.Errorf("getUserByID.(poster) [%d]: %v", issue.PosterID, err)
|
||||||
}
|
}
|
||||||
|
err = nil
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue