mirror of
https://github.com/octoleo/syncthing.git
synced 2025-02-13 17:18:45 +00:00
lib/model: Catch racy nil deref in ClusterConfig (#5106)
This commit is contained in:
parent
54d610878d
commit
dfe4008607
@ -953,12 +953,17 @@ func (m *Model) ClusterConfig(deviceID protocol.DeviceID, cm protocol.ClusterCon
|
|||||||
if cfg.Paused {
|
if cfg.Paused {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
fs, ok := m.folderFiles[folder.ID]
|
||||||
|
if !ok {
|
||||||
|
// Shouldn't happen because !cfg.Paused, but might happen
|
||||||
|
// if the folder is about to be unpaused, but not yet.
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
if !folder.DisableTempIndexes {
|
if !folder.DisableTempIndexes {
|
||||||
tempIndexFolders = append(tempIndexFolders, folder.ID)
|
tempIndexFolders = append(tempIndexFolders, folder.ID)
|
||||||
}
|
}
|
||||||
|
|
||||||
fs := m.folderFiles[folder.ID]
|
|
||||||
myIndexID := fs.IndexID(protocol.LocalDeviceID)
|
myIndexID := fs.IndexID(protocol.LocalDeviceID)
|
||||||
mySequence := fs.Sequence(protocol.LocalDeviceID)
|
mySequence := fs.Sequence(protocol.LocalDeviceID)
|
||||||
var startSequence int64
|
var startSequence int64
|
||||||
|
Loading…
x
Reference in New Issue
Block a user