lib/model: Handle concurrently removed device in ClusterConfig (#6666)

This commit is contained in:
Simon Frei 2020-05-20 11:13:55 +02:00 committed by GitHub
parent 8343db6766
commit cf75329067
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -956,7 +956,11 @@ func (m *model) ClusterConfig(deviceID protocol.DeviceID, cm protocol.ClusterCon
}
changed := false
deviceCfg := m.cfg.Devices()[deviceID]
deviceCfg, ok := m.cfg.Devices()[deviceID]
if !ok {
l.Debugln("Device disappeared from config while processing cluster-config")
return errDeviceUnknown
}
// Needs to happen outside of the fmut, as can cause CommitConfiguration
if deviceCfg.AutoAcceptFolders {