1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-15 23:17:19 +00:00

Replace -1 with GhostUserID (#27703)

This commit is contained in:
Nanguan Lin
2023-10-20 22:43:08 +08:00
committed by GitHub
parent eb1478791f
commit 881806a50b
7 changed files with 18 additions and 13 deletions

View File

@@ -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)