Browse Source

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

Simon Frei 5 years ago
parent
commit
cf75329067
1 changed files with 5 additions and 1 deletions
  1. 5 1
      lib/model/model.go

+ 5 - 1
lib/model/model.go

@@ -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 {