Fixed a bug that caused restoration of two adjacent files to crash

This commit is contained in:
Gilbert Chen
2017-06-09 21:05:44 -04:00
parent 26f2ebd8dd
commit dd11641611
2 changed files with 15 additions and 1 deletions

View File

@@ -110,7 +110,7 @@ func (downloader *ChunkDownloader) AddFiles(snapshot *Snapshot, files [] *Entry)
}
downloader.taskList = append(downloader.taskList, task)
} else {
downloader.taskList[lastChunkIndex].needed = true
downloader.taskList[len(downloader.taskList) - 1].needed = true
}
lastChunkIndex = i
}