diff options
author | Dingjun <fangdingjun@gmail.com> | 2018-08-01 17:38:56 +0800 |
---|---|---|
committer | Lunny Xiao <xiaolunwen@gmail.com> | 2018-08-01 17:38:56 +0800 |
commit | 819f50ccd50b6f7ff320e1341cf430356d5c01fb (patch) | |
tree | 7b8beafe0527bce1f3022c78a2fc2869344e3743 /routers/user | |
parent | ced08d18a40b71cf4a290d9795280c2ef79e168f (diff) | |
download | gitea-819f50ccd50b6f7ff320e1341cf430356d5c01fb.tar.gz gitea-819f50ccd50b6f7ff320e1341cf430356d5c01fb.zip |
fix panic issue on update avatar email (#4580) (#4581)
fix #4580
Diffstat (limited to 'routers/user')
-rw-r--r-- | routers/user/setting/profile.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/routers/user/setting/profile.go b/routers/user/setting/profile.go index 22511ab891..6a2eacd09d 100644 --- a/routers/user/setting/profile.go +++ b/routers/user/setting/profile.go @@ -119,7 +119,7 @@ func UpdateAvatarSetting(ctx *context.Context, form auth.AvatarForm, ctxUser *mo ctxUser.AvatarEmail = form.Gravatar } - if form.Avatar.Filename != "" { + if form.Avatar != nil && form.Avatar.Filename != "" { fr, err := form.Avatar.Open() if err != nil { return fmt.Errorf("Avatar.Open: %v", err) |