Skip to content

Commit

Permalink
fix panic issue on update avatar email (#4580) (#4581)
Browse files Browse the repository at this point in the history
fix #4580
  • Loading branch information
fangdingjun authored and lunny committed Aug 1, 2018
1 parent ced08d1 commit 819f50c
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 819f50c

Please sign in to comment.