Skip to content

Commit 819f50c

Browse files
fangdingjunlunny
authored andcommitted
fix panic issue on update avatar email (#4580) (#4581)
fix #4580
1 parent ced08d1 commit 819f50c

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)