diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2016-11-09 15:14:18 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-09 15:14:18 +0800 |
commit | c511f1c6c36e697906fd4833aa24924b98c60e6a (patch) | |
tree | 8f199fb45e58f083f0997bee3f4480e208fb2fe2 /models | |
parent | 45c4539c6168aa248e425033731ab7a9a21c5958 (diff) | |
parent | a6c487f6caa93c3b661ecc345b2f95c206718316 (diff) | |
download | gitea-c511f1c6c36e697906fd4833aa24924b98c60e6a.tar.gz gitea-c511f1c6c36e697906fd4833aa24924b98c60e6a.zip |
Merge pull request #18 from LefsFlarey/issue/3675
Fix 500 error caused by deleted users on issues (#3675)
Diffstat (limited to 'models')
-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 } } |