mirror of
				https://github.com/go-gitea/gitea
				synced 2025-11-03 21:08:25 +00:00 
			
		
		
		
	Ignore empty avatars in v115.go (#9520)
* Ignore empty avatars * fixup! Ignore empty avatars
This commit is contained in:
		@@ -47,7 +47,10 @@ func renameExistingUserAvatarName(x *xorm.Engine) error {
 | 
				
			|||||||
		for _, user := range users {
 | 
							for _, user := range users {
 | 
				
			||||||
			oldAvatar := user.Avatar
 | 
								oldAvatar := user.Avatar
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			if _, err := os.Stat(filepath.Join(setting.AvatarUploadPath, oldAvatar)); err != nil {
 | 
								if stat, err := os.Stat(filepath.Join(setting.AvatarUploadPath, oldAvatar)); err != nil || !stat.Mode().IsRegular() {
 | 
				
			||||||
 | 
									if err == nil {
 | 
				
			||||||
 | 
										err = fmt.Errorf("Error: \"%s\" is not a regular file", oldAvatar)
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
				log.Warn("[user: %s] os.Stat: %v", user.LowerName, err)
 | 
									log.Warn("[user: %s] os.Stat: %v", user.LowerName, err)
 | 
				
			||||||
				// avatar doesn't exist in the storage
 | 
									// avatar doesn't exist in the storage
 | 
				
			||||||
				// no need to move avatar and update database
 | 
									// no need to move avatar and update database
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user