diff --git a/cmd/syncthing/main.go b/cmd/syncthing/main.go index 6f1e252ef..181ac507f 100644 --- a/cmd/syncthing/main.go +++ b/cmd/syncthing/main.go @@ -431,8 +431,8 @@ nextRepo: if repo.Invalid != "" { continue } - repo.Directory = expandTilde(repo.Directory) + m.AddRepo(repo) fi, err := os.Stat(repo.Directory) if m.LocalVersion(repo.ID) > 0 { @@ -458,8 +458,6 @@ nextRepo: cfg.Repositories[i].Invalid = err.Error() continue nextRepo } - - m.AddRepo(repo) } // GUI diff --git a/model/model.go b/model/model.go index ecef5152d..16c84963c 100644 --- a/model/model.go +++ b/model/model.go @@ -1044,7 +1044,7 @@ func (m *Model) LocalVersion(repo string) uint64 { fs, ok := m.repoFiles[repo] if !ok { - return 0 + panic("bug: LocalVersion called for nonexistent repo " + repo) } ver := fs.LocalVersion(protocol.LocalNodeID)