diff --git a/routers/web/user/avatar.go b/routers/web/user/avatar.go index 53a603fab094d..05896299d25ef 100644 --- a/routers/web/user/avatar.go +++ b/routers/web/user/avatar.go @@ -31,6 +31,10 @@ func AvatarByUserName(ctx *context.Context) { if strings.ToLower(userName) != "ghost" { var err error if user, err = user_model.GetUserByName(ctx, userName); err != nil { + if user_model.IsErrUserNotExist(err) { + ctx.NotFound("GetUserByName", err) + return + } ctx.ServerError("Invalid user: "+userName, err) return }