diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2018-01-07 03:13:10 -0600 |
---|---|---|
committer | Lauris BH <lauris@nix.lv> | 2018-01-07 11:13:10 +0200 |
commit | 835b89032917d0f007b61a0532842d9b066eee93 (patch) | |
tree | c7070aa1b544bfbf4dc813c43314d8766ce67ba4 /models | |
parent | 40023281791a4c8d390f8531d1f27f7f6f6a7157 (diff) | |
download | gitea-835b89032917d0f007b61a0532842d9b066eee93.tar.gz gitea-835b89032917d0f007b61a0532842d9b066eee93.zip |
fix bug when a user delete but assigned on issue (#3318)
Diffstat (limited to 'models')
-rw-r--r-- | models/issue_comment.go | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/models/issue_comment.go b/models/issue_comment.go index 2f4ddd63ec..f97c108a7f 100644 --- a/models/issue_comment.go +++ b/models/issue_comment.go @@ -247,14 +247,20 @@ func (c *Comment) LoadAssignees() error { if c.OldAssigneeID > 0 { c.OldAssignee, err = getUserByID(x, c.OldAssigneeID) if err != nil { - return err + if !IsErrUserNotExist(err) { + return err + } + c.OldAssignee = NewGhostUser() } } if c.AssigneeID > 0 { c.Assignee, err = getUserByID(x, c.AssigneeID) if err != nil { - return err + if !IsErrUserNotExist(err) { + return err + } + c.Assignee = NewGhostUser() } } return nil |