mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-04-16 12:12:25 +00:00
Return default avatar url when user id is zero rather than updating database (#34094)
(cherry picked from commit 88352e0b252e9186a5633d39124a8a65ab89f831)
This commit is contained in:
parent
39341df8cb
commit
02d9c7cd27
1 changed files with 1 additions and 1 deletions
|
@ -62,7 +62,7 @@ func GenerateRandomAvatar(ctx context.Context, u *User) error {
|
|||
|
||||
// AvatarLinkWithSize returns a link to the user's avatar with size. size <= 0 means default size
|
||||
func (u *User) AvatarLinkWithSize(ctx context.Context, size int) string {
|
||||
if u.IsGhost() {
|
||||
if u.IsGhost() || u.ID <= 0 {
|
||||
return avatars.DefaultAvatarLink()
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue