mirror of
https://github.com/octoleo/syncthing.git
synced 2024-12-31 22:11:51 +00:00
Merge pull request #200 from veeti/fix-no-repositories
Return a blank array instead of null if there are no repositories
This commit is contained in:
commit
1338b0a2f8
@ -171,6 +171,11 @@ func readConfigXML(rd io.Reader, myID string) (Configuration, error) {
|
||||
|
||||
cfg.Options.ListenAddress = uniqueStrings(cfg.Options.ListenAddress)
|
||||
|
||||
// Initialize an empty slice for repositories if the config has none
|
||||
if cfg.Repositories == nil {
|
||||
cfg.Repositories = []RepositoryConfiguration{}
|
||||
}
|
||||
|
||||
// Check for missing, bad or duplicate repository ID:s
|
||||
var seenRepos = map[string]*RepositoryConfiguration{}
|
||||
for i := range cfg.Repositories {
|
||||
|
Loading…
Reference in New Issue
Block a user