0
0
Fork 0
mirror of https://github.com/go-gitea/gitea synced 2024-11-25 09:52:46 +01:00

Bug fixed for org avatar caused by #1049 (#1070)

* bug fixed for org avatar caused by #1049

* use isfile only
This commit is contained in:
Lunny Xiao 2017-02-27 08:42:22 +08:00 committed by GitHub
parent a5ac4c64fc
commit 522f194983

View file

@ -324,12 +324,12 @@ func (u *User) RelAvatarLink() string {
switch {
case u.UseCustomAvatar:
if !com.IsExist(u.CustomAvatarPath()) {
if !com.IsFile(u.CustomAvatarPath()) {
return defaultImgURL
}
return setting.AppSubURL + "/avatars/" + u.Avatar
case setting.DisableGravatar, setting.OfflineMode:
if !com.IsExist(u.CustomAvatarPath()) {
if !com.IsFile(u.CustomAvatarPath()) {
if err := u.GenerateRandomAvatar(); err != nil {
log.Error(3, "GenerateRandomAvatar: %v", err)
}