cmd/syncthing: Don't crash when failing to create default config (fixes #6655) (#6658)

This is not an ignorable error, because it can happen if we fail to
allocate a free port for the GUI or sync port on first startup.
This commit is contained in:
Jakob Borg 2020-05-17 07:56:24 +02:00 committed by GitHub
parent 1c5af3a4bd
commit 5c54d879a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -527,7 +527,10 @@ func (e errNoUpgrade) Error() string {
}
func checkUpgrade() (upgrade.Release, error) {
cfg, _ := loadOrDefaultConfig(protocol.EmptyDeviceID, events.NoopLogger)
cfg, err := loadOrDefaultConfig(protocol.EmptyDeviceID, events.NoopLogger)
if err != nil {
return upgrade.Release{}, err
}
opts := cfg.Options()
release, err := upgrade.LatestRelease(opts.ReleasesURL, build.Version, opts.UpgradeToPreReleases)
if err != nil {