From 73dbaefec50c4fc99a63c5be2891a1a34db18767 Mon Sep 17 00:00:00 2001 From: Wei He Date: Fri, 25 May 2018 21:19:04 -0400 Subject: [PATCH] routes/user/setting: fix avatar email update error (#5245) --- routes/user/setting.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routes/user/setting.go b/routes/user/setting.go index 4b8b48bbe..35188d670 100644 --- a/routes/user/setting.go +++ b/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)