Skip to content

Commit 9b6504b

Browse files
committedNov 11, 2016
fix seeding torrents when missing from tracker
1 parent ce8c9a2 commit 9b6504b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎background-window.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ module.exports = function (client, config) {
330330
// seed rarest torrents first
331331
getTorrentInfo(localTorrents, (err, info) => {
332332
if (err) return console.log(err)
333-
localTorrents.map(infoHash => [infoHash, info[infoHash].complete]).sort((a, b) => {
333+
localTorrents.map(infoHash => [infoHash, info[infoHash] && info[infoHash].complete || 0]).sort((a, b) => {
334334
return (a[1] + Math.random()) - (b[1] + Math.random())
335335
}).slice(0, maxSeed).forEach((item) => {
336336
watchTorrent(item[0])

0 commit comments

Comments
 (0)
Please sign in to comment.