lib/model: Don't panic when rechecking file (fixes #5002) (#5003)

This commit is contained in:
Jakob Borg
2018-06-13 19:07:52 +02:00
committed by Audrius Butkevicius
parent c7c7fbe9d9
commit 35a75a95dc
2 changed files with 27 additions and 1 deletions

View File

@@ -1373,7 +1373,7 @@ func (m *Model) recheckFile(deviceID protocol.DeviceID, folderFs fs.Filesystem,
return
}
if blockIndex > len(cf.Blocks) {
if blockIndex >= len(cf.Blocks) {
l.Debugf("%v recheckFile: %s: %q / %q i=%d: block index too far", m, deviceID, folder, name, blockIndex)
return
}