1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2024-12-27 13:39:19 -05:00

fix panic issue on update avatar email (#4580) (#4581)

fix #4580
This commit is contained in:
Dingjun 2018-08-01 17:38:56 +08:00 committed by Lunny Xiao
parent ced08d18a4
commit 819f50ccd5

View file

@ -119,7 +119,7 @@ func UpdateAvatarSetting(ctx *context.Context, form auth.AvatarForm, ctxUser *mo
ctxUser.AvatarEmail = form.Gravatar ctxUser.AvatarEmail = form.Gravatar
} }
if form.Avatar.Filename != "" { if form.Avatar != nil && form.Avatar.Filename != "" {
fr, err := form.Avatar.Open() fr, err := form.Avatar.Open()
if err != nil { if err != nil {
return fmt.Errorf("Avatar.Open: %v", err) return fmt.Errorf("Avatar.Open: %v", err)