summaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
Diffstat (limited to 'models')
-rw-r--r--models/migrations/migrations.go2
-rw-r--r--models/migrations/v20.go4
2 files changed, 5 insertions, 1 deletions
diff --git a/models/migrations/migrations.go b/models/migrations/migrations.go
index 226e548171..b3e7fcc8c6 100644
--- a/models/migrations/migrations.go
+++ b/models/migrations/migrations.go
@@ -89,7 +89,7 @@ var migrations = []Migration{
// v19 -> v20
NewMigration("generate and migrate Git hooks", generateAndMigrateGitHooks),
// v20 -> v21
- NewMigration("use new avtar path name for security reason", useNewNameAvatars),
+ NewMigration("use new avatar path name for security reason", useNewNameAvatars),
}
// Migrate database to current version
diff --git a/models/migrations/v20.go b/models/migrations/v20.go
index 134a3d51e6..45d7e49ca8 100644
--- a/models/migrations/v20.go
+++ b/models/migrations/v20.go
@@ -21,6 +21,10 @@ import (
func useNewNameAvatars(x *xorm.Engine) error {
d, err := os.Open(setting.AvatarUploadPath)
if err != nil {
+ if os.IsNotExist(err) {
+ // Nothing to do if AvatarUploadPath does not exist
+ return nil
+ }
return err
}
names, err := d.Readdirnames(0)