Repository: syncthing/syncthing (language: go)

Issue:
Perhaps the list of devices contains empty elements
https://github.com/syncthing/syncthing/blob/main/lib/model/model.go#L1279


Discussion / hints:
Yeah there's a "0, " missing there for sure. 

Fix patch:
diff --git a/lib/model/model.go b/lib/model/model.go
index 24b37ece83e..5f996fb69b6 100644
--- a/lib/model/model.go
+++ b/lib/model/model.go
@@ -1276,7 +1276,7 @@ func (m *model) ClusterConfig(deviceID protocol.DeviceID, cm protocol.ClusterCon
 			for _, fcfg := range folders {
 				cfg.Folders = append(cfg.Folders, fcfg)
 			}
-			cfg.Devices = make([]config.DeviceConfiguration, len(devices))
+			cfg.Devices = make([]config.DeviceConfiguration, 0, len(devices))
 			for _, dcfg := range devices {
 				cfg.Devices = append(cfg.Devices, dcfg)
 			}


Test patch: