mirror of
https://github.com/octoleo/syncthing.git
synced 2025-01-24 07:28:27 +00:00
Return a blank array instead of null if there are no repositories
Fixes a bug where it's impossible to add repositories in the web interface if none are defined.
This commit is contained in:
parent
532b576fd5
commit
85d5449b3c
@ -171,6 +171,11 @@ func readConfigXML(rd io.Reader, myID string) (Configuration, error) {
|
|||||||
|
|
||||||
cfg.Options.ListenAddress = uniqueStrings(cfg.Options.ListenAddress)
|
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
|
// 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 {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user