Fix selectFiles error, fixes #891

This commit is contained in:
DC
2016-09-04 14:56:17 -07:00
parent 7a757f9e05
commit f2007be1b0
2 changed files with 6 additions and 1 deletions

View File

@@ -127,7 +127,9 @@ module.exports = class TorrentListController {
torrentSummary.selections[index] = !torrentSummary.selections[index]
// Let the WebTorrent process know to start or stop fetching that file
ipcRenderer.send('wt-select-files', infoHash, torrentSummary.selections)
if (torrentSummary.status !== 'paused') {
ipcRenderer.send('wt-select-files', infoHash, torrentSummary.selections)
}
}
confirmDeleteTorrent (infoHash, deleteData) {

View File

@@ -350,6 +350,9 @@ function selectFiles (torrentOrInfoHash, selections) {
} else {
torrent = torrentOrInfoHash
}
if (!torrent) {
throw new Error('selectFiles: missing torrent ' + torrentOrInfoHash)
}
// Selections not specified?
// Load all files. We still need to replace the default whole-torrent