From 87b9dba5685578f5ea51647523d9bd1fa1dcf728 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Wed, 3 Aug 2016 17:06:04 -0700 Subject: [PATCH] Fix "Cannot read property 'numPiecesPresent' of undefined" Fixes #695 --- src/renderer/views/torrent-list.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/renderer/views/torrent-list.js b/src/renderer/views/torrent-list.js index 74afa8cf..0c9aa403 100644 --- a/src/renderer/views/torrent-list.js +++ b/src/renderer/views/torrent-list.js @@ -255,7 +255,8 @@ module.exports = class TorrentList extends React.Component { var isSelected = torrentSummary.selections && torrentSummary.selections[index] var isDone = false // Are we finished torrenting it? var progress = '' - if (torrentSummary.progress && torrentSummary.progress.files) { + if (torrentSummary.progress && torrentSummary.progress.files && + torrentSummary.progress.files[index]) { var fileProg = torrentSummary.progress.files[index] isDone = fileProg.numPiecesPresent === fileProg.numPieces progress = Math.round(100 * fileProg.numPiecesPresent / fileProg.numPieces) + '%'