diff --git a/index.js b/index.js index c94470c..b785332 100644 --- a/index.js +++ b/index.js @@ -32,7 +32,14 @@ if (mode == 'cli') { const app = e(); app.get('/top', async (req, res) => { let json = await fetch("https://nbg.dervland.net/api/followjson.php"); - json = await json.json(); + try { + json = await json.json(); + } catch (err) { + json = {}; + res.send(JSON.stringify({})); + return; + } + let { ref } = req.query;