Browse Source

routes/user/setting: fix avatar email update error (#5245)

pull/4643/merge
Wei He 7 years ago committed by 无闻
parent
commit
73dbaefec5
  1. 2
      routes/user/setting.go

2
routes/user/setting.go

@ -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…
Cancel
Save