From 9dcbc1b1f68f64e9775fd281609b2b0dd22416fc Mon Sep 17 00:00:00 2001 From: Mathias Rasmussen Date: Fri, 2 Sep 2016 00:54:37 +0200 Subject: [PATCH] ensure that torrent file metadata is present (#869) --- src/renderer/controllers/torrent-list-controller.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/renderer/controllers/torrent-list-controller.js b/src/renderer/controllers/torrent-list-controller.js index c155fbcf..a218a4d0 100644 --- a/src/renderer/controllers/torrent-list-controller.js +++ b/src/renderer/controllers/torrent-list-controller.js @@ -84,8 +84,13 @@ module.exports = class TorrentListController { return start() } + var fileOrFolder = TorrentSummary.getFileOrFolder(s) + + // New torrent: metadata not yet received + if (!fileOrFolder) return start() + // Existing torrent: check that the path is still there - fs.stat(TorrentSummary.getFileOrFolder(s), function (err) { + fs.stat(fileOrFolder, function (err) { if (err) { s.error = 'path-missing' return