From 47e70bbf0ea42f21a83b15e669415ed5a1851978 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 (cherry picked from commit f80ea95eb538decad4d982ce96f640b18e430393) --- 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 8c333bc6dd..8b00adda99 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 }