From faabeed246ea3d763bbe74b2ae0e43a429c753c0 Mon Sep 17 00:00:00 2001 From: Alexey Kasyanchuk Date: Sat, 14 Sep 2019 18:44:42 +0300 Subject: [PATCH] fix(search): fix error on some cases of torrent opening Fixed #98 --- src/background/api.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/background/api.js b/src/background/api.js index 346d3c3..dd49a0b 100644 --- a/src/background/api.js +++ b/src/background/api.js @@ -168,7 +168,15 @@ module.exports = async ({ if(options.files) { - torrent.filesList = parseTorrentFiles(await sphinx.query('SELECT * FROM `files` WHERE `hash` = ?', hash)); + const filesList = await sphinx.query('SELECT * FROM `files` WHERE `hash` = ?', hash); + if (filesList) + { + torrent.filesList = parseTorrentFiles(filesList); + } + else + { + logTE('search', "can't find filesList for torrent", hash, " - ignore it.") + } callback(baseRowData(torrent)) } else