mirror of
https://github.com/octoleo/syncthing.git
synced 2024-12-23 11:28:59 +00:00
Empty directories are invalid (ref #188)
This commit is contained in:
parent
1bf07d6b58
commit
e8a9abaf40
@ -171,11 +171,16 @@ func readConfigXML(rd io.Reader, myID string) (Configuration, error) {
|
|||||||
|
|
||||||
cfg.Options.ListenAddress = uniqueStrings(cfg.Options.ListenAddress)
|
cfg.Options.ListenAddress = uniqueStrings(cfg.Options.ListenAddress)
|
||||||
|
|
||||||
// Check for missing or duplicate repository ID:s
|
// Check for missing, bad or duplicate repository ID:s
|
||||||
var seenRepos = map[string]*RepositoryConfiguration{}
|
var seenRepos = map[string]*RepositoryConfiguration{}
|
||||||
for i := range cfg.Repositories {
|
for i := range cfg.Repositories {
|
||||||
repo := &cfg.Repositories[i]
|
repo := &cfg.Repositories[i]
|
||||||
|
|
||||||
|
if len(repo.Directory) == 0 {
|
||||||
|
repo.Invalid = "empty directory"
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
if repo.ID == "" {
|
if repo.ID == "" {
|
||||||
repo.ID = "default"
|
repo.ID = "default"
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user