]> source.dussan.org Git - gitea.git/commitdiff
Fix gitea-action user avatar broken on edited menu (#29190) (#29307)
authoryp05327 <576951401@qq.com>
Thu, 22 Feb 2024 02:53:38 +0000 (11:53 +0900)
committerGitHub <noreply@github.com>
Thu, 22 Feb 2024 02:53:38 +0000 (02:53 +0000)
Backport #29190

Fix #29178

models/issues/content_history.go

index 8c333bc6dd37c5e0589a8efee17645030bb85581..8b00adda99a18e3f5219f4e6af89779750c397fb 100644 (file)
@@ -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
 }