fix(search): fix error on some cases of torrent opening

Fixed #98
This commit is contained in:
Alexey Kasyanchuk 2019-09-14 18:44:42 +03:00
parent e281163a18
commit faabeed246

View File

@ -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