From f80ea95eb538decad4d982ce96f640b18e430393 Mon Sep 17 00:00:00 2001 From: yp05327 <576951401@qq.com> Date: Thu, 22 Feb 2024 11:53:38 +0900 Subject: [PATCH] Fix gitea-action user avatar broken on edited menu (#29190) (#29307) Backport #29190 Fix #29178 --- models/issues/content_history.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/models/issues/content_history.go b/models/issues/content_history.go index 8c333bc6d..8b00adda9 100644 --- a/models/issues/content_history.go +++ b/models/issues/content_history.go @@ -161,7 +161,11 @@ func FetchIssueContentHistoryList(dbCtx context.Context, issueID, commentID int6 } for _, item := range res { - item.UserAvatarLink = avatars.GenerateUserAvatarFastLink(item.UserName, 0) + if item.UserID > 0 { + item.UserAvatarLink = avatars.GenerateUserAvatarFastLink(item.UserName, 0) + } else { + item.UserAvatarLink = avatars.DefaultAvatarLink() + } } return res, nil }