Skip to content

Commit 73608e3

Browse files
committed
fix panic issue on update avatar email (go-gitea#4580) (go-gitea#4581)
fix go-gitea#4580
1 parent 5a7830e commit 73608e3

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)