1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2025-08-11 17:50:57 +00:00

fix 500 when delete orgnization and resolved #486 (#507)

This commit is contained in:
Lunny Xiao 2016-12-28 08:53:17 +08:00 committed by GitHub
parent e8bac94d1f
commit fbb424c61d
2 changed files with 11 additions and 8 deletions

View file

@ -885,8 +885,10 @@ func deleteUser(e *xorm.Session, u *User) error {
}
avatarPath := u.CustomAvatarPath()
if err := os.Remove(avatarPath); err != nil {
return fmt.Errorf("Fail to remove %s: %v", avatarPath, err)
if com.IsExist(avatarPath) {
if err := os.Remove(avatarPath); err != nil {
return fmt.Errorf("Fail to remove %s: %v", avatarPath, err)
}
}
return nil