Skip to content

Commit

Permalink
fix panic issue on update avatar email (#4580) (#4590)
Browse files Browse the repository at this point in the history
fix #4580

back port PR for release/v1.5,  refer to #4581
  • Loading branch information
fangdingjun authored and appleboy committed Aug 1, 2018
1 parent 5a7830e commit 940e30b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion routers/user/setting/profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 940e30b

Please sign in to comment.