lib/model: Don't close file early (fixes #6875) (#6876)

This commit is contained in:
Audrius Butkevicius
2020-08-03 21:54:42 +02:00
committed by GitHub
parent bbf25e2d02
commit 96e197e502
2 changed files with 86 additions and 80 deletions
+1 -1
View File
@@ -1312,10 +1312,10 @@ func (f *sendReceiveFolder) copierRoutine(in <-chan copyBlocksState, pullChan ch
if err != nil {
return false
}
defer fd.Close()
srcOffset := int64(state.file.BlockSize()) * int64(index)
_, err = fd.ReadAt(buf, srcOffset)
fd.Close()
if err != nil {
return false
}