mirror of https://github.com/gogs/gogs.git
routes/user/setting: fix avatar email update error (#5245)
parent
05edcde6c9
commit
73dbaefec5
|
@ -119,7 +119,7 @@ func UpdateAvatarSetting(c *context.Context, f form.Avatar, ctxUser *models.User
|
|||
ctxUser.AvatarEmail = f.Gravatar
|
||||
}
|
||||
|
||||
if f.Avatar != nil {
|
||||
if f.Avatar != nil && f.Avatar.Filename != "" {
|
||||
r, err := f.Avatar.Open()
|
||||
if err != nil {
|
||||
return fmt.Errorf("Avatar.Open: %v", err)
|
||||
|
|
Loading…
Reference in New Issue