fix: correctly return cached intitals avatar

Resolves https://vikunja.sentry.io/issues/6752872121/events/92ff6a64c4b64aa3aecc6973611bd449/
This commit is contained in:
kolaente 2025-07-18 18:28:19 +02:00
parent 566657c54a
commit c3fd659851
1 changed files with 10 additions and 2 deletions

View File

@ -144,12 +144,20 @@ func getAvatarForUser(u *user.User) (fullSizeAvatar *image.RGBA64, err error) {
firstRune := []rune(strings.ToUpper(avatarText))[0]
bg := avatarBgColors[int(u.ID)%len(avatarBgColors)] // Random color based on the user id
return drawImage(firstRune, bg)
res, err := drawImage(firstRune, bg)
if err != nil {
return nil, err
}
return *res, nil
})
if err != nil {
return nil, err
}
return result.(*image.RGBA64), nil
aa := result.(image.RGBA64)
return &aa, nil
}
// CachedAvatar represents a cached avatar with its content and mime type