summaryrefslogtreecommitdiffstats
path: root/models/user.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2016-12-27 10:02:14 +0800
committerKim "BKC" Carlbäcker <kim.carlbacker@gmail.com>2016-12-27 12:00:12 +0100
commitba134bd27abe099efcd748773c410b3aa78521fc (patch)
tree8468ddbd61dd7af49a9fbf50bc71179ee6b9b21c /models/user.go
parent59f736d54c3edf7072b5adc9193896e039f6d8e7 (diff)
downloadgitea-ba134bd27abe099efcd748773c410b3aa78521fc.tar.gz
gitea-ba134bd27abe099efcd748773c410b3aa78521fc.zip
fix 500 when delete orgnization and resolved #486
Diffstat (limited to 'models/user.go')
-rw-r--r--models/user.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/models/user.go b/models/user.go
index 803cb3b03e..d48397ef7e 100644
--- a/models/user.go
+++ b/models/user.go
@@ -891,8 +891,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