don't remove old user custom avatar when old custom avatar type is empty

This commit is contained in:
MaysWind
2024-08-11 12:17:48 +08:00
parent f4a27e59a3
commit 0d706abbd3
+1 -1
View File
@@ -563,7 +563,7 @@ func (a *UsersApi) UserUpdateAvatarHandler(c *core.Context) (any, *errs.Error) {
return nil, errs.Or(err, errs.ErrOperationFailed)
}
if fileExtension != user.CustomAvatarType {
if fileExtension != user.CustomAvatarType && user.CustomAvatarType != "" {
err = storage.Container.DeleteAvatar(user.Uid, user.CustomAvatarType)
if err != nil {