diff options
Diffstat (limited to 'routers/user/setting.go')
-rw-r--r-- | routers/user/setting.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/routers/user/setting.go b/routers/user/setting.go index f9704ba946..9a9aa57e07 100644 --- a/routers/user/setting.go +++ b/routers/user/setting.go @@ -79,8 +79,10 @@ func SettingsPost(ctx *middleware.Context, form auth.UpdateProfileForm) { ctx.User.Email = form.Email ctx.User.Website = form.Website ctx.User.Location = form.Location - ctx.User.Avatar = base.EncodeMD5(form.Gravatar) - ctx.User.AvatarEmail = form.Gravatar + if len(form.Gravatar) > 0 { + ctx.User.Avatar = base.EncodeMD5(form.Gravatar) + ctx.User.AvatarEmail = form.Gravatar + } if err := models.UpdateUser(ctx.User); err != nil { ctx.Handle(500, "UpdateUser", err) return |