ensure that torrent file metadata is present (#869)

This commit is contained in:
Mathias Rasmussen
2016-09-02 00:54:37 +02:00
committed by DC
parent d806fd502f
commit 9dcbc1b1f6

View File

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