From e8a9abaf40b35af0fe3d0976007be76a206639e1 Mon Sep 17 00:00:00 2001 From: Jakob Borg Date: Mon, 12 May 2014 21:30:04 -0300 Subject: [PATCH] Empty directories are invalid (ref #188) --- cmd/syncthing/config.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cmd/syncthing/config.go b/cmd/syncthing/config.go index b42e2207f..7bd833dcb 100644 --- a/cmd/syncthing/config.go +++ b/cmd/syncthing/config.go @@ -171,11 +171,16 @@ func readConfigXML(rd io.Reader, myID string) (Configuration, error) { 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{} for i := range cfg.Repositories { repo := &cfg.Repositories[i] + if len(repo.Directory) == 0 { + repo.Invalid = "empty directory" + continue + } + if repo.ID == "" { repo.ID = "default" }