diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2016-11-09 08:14:18 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-09 08:14:18 +0100 |
commit | c511f1c6c36e697906fd4833aa24924b98c60e6a (patch) | |
tree | 8f199fb45e58f083f0997bee3f4480e208fb2fe2 /models/issue.go | |
parent | Merge pull request #17 from LefsFlarey/issue/3666 (diff) | |
parent | Fix err not being nil (diff) | |
download | forgejo-c511f1c6c36e697906fd4833aa24924b98c60e6a.tar.xz forgejo-c511f1c6c36e697906fd4833aa24924b98c60e6a.zip |
Merge pull request #18 from LefsFlarey/issue/3675
Fix 500 error caused by deleted users on issues (#3675)
Diffstat (limited to 'models/issue.go')
-rw-r--r-- | models/issue.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/models/issue.go b/models/issue.go index 6078f53f2d..0f63fa6923 100644 --- a/models/issue.go +++ b/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 } } |