lib/config: Reject empty folder IDs
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/4698 LGTM: imsodin
This commit is contained in:
@@ -260,6 +260,10 @@ func (cfg *Configuration) clean() error {
|
||||
folder := &cfg.Folders[i]
|
||||
folder.prepare()
|
||||
|
||||
if folder.ID == "" {
|
||||
return fmt.Errorf("folder with empty ID in configuration")
|
||||
}
|
||||
|
||||
if _, ok := seenFolders[folder.ID]; ok {
|
||||
return fmt.Errorf("duplicate folder ID %q in configuration", folder.ID)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user