Skip to content

Commit 940e30b

Browse files
fangdingjunappleboy
authored andcommitted
fix panic issue on update avatar email (#4580) (#4590)
fix #4580 back port PR for release/v1.5, refer to #4581
1 parent 5a7830e commit 940e30b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

routers/user/setting/profile.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ func UpdateAvatarSetting(ctx *context.Context, form auth.AvatarForm, ctxUser *mo
119119
ctxUser.AvatarEmail = form.Gravatar
120120
}
121121

122-
if form.Avatar.Filename != "" {
122+
if form.Avatar != nil && form.Avatar.Filename != "" {
123123
fr, err := form.Avatar.Open()
124124
if err != nil {
125125
return fmt.Errorf("Avatar.Open: %v", err)

0 commit comments

Comments
 (0)