| catch error if no torrents are in the DB - seedlinux - Torrent indexing tool op… | |
| Log | |
| Files | |
| Refs | |
| README | |
| --- | |
| commit 822f48597fe37b14645e5c936e133620a16ffd56 | |
| parent c8ec4202dff0fc6092abe1e4c387adf0d4655801 | |
| Author: Jay Scott <[email protected]> | |
| Date: Fri, 30 Jun 2017 11:26:56 +0100 | |
| catch error if no torrents are in the DB | |
| Diffstat: | |
| M controllers/torrents_controller.js | 4 ++++ | |
| 1 file changed, 4 insertions(+), 0 deletions(-) | |
| --- | |
| diff --git a/controllers/torrents_controller.js b/controllers/torrents_controll… | |
| @@ -13,6 +13,10 @@ exports.index = function(req, res) { | |
| Torrent.find({},callback); | |
| }, | |
| }, function(err, results) { | |
| + if(!results) { | |
| + console.log(results.torrent_count); | |
| + results.torrent_count == 0; | |
| + } | |
| res.render('torrent', { title: 'Index Page', error: err, data: results… | |
| }); | |
| }; |