Replace -1 with GhostUserID (#27703)
This commit is contained in:
parent
eb1478791f
commit
881806a50b
7 changed files with 18 additions and 13 deletions
|
@ -349,7 +349,7 @@ func (c *Comment) LoadPoster(ctx context.Context) (err error) {
|
|||
c.Poster, err = user_model.GetPossibleUserByID(ctx, c.PosterID)
|
||||
if err != nil {
|
||||
if user_model.IsErrUserNotExist(err) {
|
||||
c.PosterID = -1
|
||||
c.PosterID = user_model.GhostUserID
|
||||
c.Poster = user_model.NewGhostUser()
|
||||
} else {
|
||||
log.Error("getUserByID[%d]: %v", c.ID, err)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue