lib/model, lib/protocol: Sequence ClusterConfig properly (fixes #3448)

GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3452
This commit is contained in:
Jakob Borg
2016-07-27 21:36:25 +00:00
committed by Audrius Butkevicius
parent 7c7e8648ff
commit aafc96f58f
2 changed files with 5 additions and 2 deletions

View File

@@ -649,8 +649,11 @@ func (m *Model) ClusterConfig(deviceID protocol.DeviceID, cm protocol.ClusterCon
tempIndexFolders := make([]string, 0, len(cm.Folders))
m.pmut.RLock()
conn := m.conn[deviceID]
conn, ok := m.conn[deviceID]
m.pmut.RUnlock()
if !ok {
panic("bug: ClusterConfig called on closed or nonexistent connection")
}
m.fmut.Lock()
for _, folder := range cm.Folders {