mirror of
https://github.com/octoleo/syncthing.git
synced 2024-11-09 23:00:58 +00:00
Don't crash on folder remove while pulling (fixes #2705)
This commit is contained in:
parent
ab9109e0dc
commit
acaf134dfe
@ -1168,6 +1168,10 @@ func (m *Model) updateLocals(folder string, fs []protocol.FileInfo) {
|
|||||||
m.fmut.RLock()
|
m.fmut.RLock()
|
||||||
files := m.folderFiles[folder]
|
files := m.folderFiles[folder]
|
||||||
m.fmut.RUnlock()
|
m.fmut.RUnlock()
|
||||||
|
if files == nil {
|
||||||
|
// The folder doesn't exist.
|
||||||
|
return
|
||||||
|
}
|
||||||
files.Update(protocol.LocalDeviceID, fs)
|
files.Update(protocol.LocalDeviceID, fs)
|
||||||
|
|
||||||
filenames := make([]string, len(fs))
|
filenames := make([]string, len(fs))
|
||||||
|
@ -527,6 +527,13 @@ func (p *rwFolder) pullerIteration(ignores *ignore.Matcher) int {
|
|||||||
|
|
||||||
nextFile:
|
nextFile:
|
||||||
for {
|
for {
|
||||||
|
select {
|
||||||
|
case <-p.stop:
|
||||||
|
// Stop processing files if the puller has been told to stop.
|
||||||
|
break
|
||||||
|
default:
|
||||||
|
}
|
||||||
|
|
||||||
fileName, ok := p.queue.Pop()
|
fileName, ok := p.queue.Pop()
|
||||||
if !ok {
|
if !ok {
|
||||||
break
|
break
|
||||||
|
Loading…
Reference in New Issue
Block a user