From 1f9f5aaf6f8e9b4df2df2c729758b8ddac51f03b Mon Sep 17 00:00:00 2001 From: Ashley Date: Wed, 21 Dec 2022 08:25:16 +0000 Subject: [PATCH] add try and catch to about section --- .../init/pages-channel-and-download.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/libpoketube/init/pages-channel-and-download.js b/src/libpoketube/init/pages-channel-and-download.js index 7d167f5b..feca5584 100644 --- a/src/libpoketube/init/pages-channel-and-download.js +++ b/src/libpoketube/init/pages-channel-and-download.js @@ -111,13 +111,16 @@ module.exports = function (app, config, renderTemplate) { const ID = req.query.id; const tab = req.query.tab; - // about - const bout = await modules.fetch( - config.tubeApi + `channel?id=${ID}&tab=about` - ); - const h = await bout.text(); - const k = JSON.parse(modules.toJson(h)); - + try { + // about + const bout = await modules.fetch( + config.tubeApi + `channel?id=${ID}&tab=about` + ); + const h = await bout.text(); + var k = JSON.parse(modules.toJson(h)); + } catch { + k = " "; + } if (req.query.continuation) { var continuation = req.query.continuation; }