From b34f3e8d075918a6f8b94084d5fbf65742bd540c Mon Sep 17 00:00:00 2001 From: Dalton Date: Tue, 11 Dec 2018 21:58:59 -0800 Subject: [PATCH] subreddit vomit --- bot.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bot.js b/bot.js index 62069a7..dde84a8 100644 --- a/bot.js +++ b/bot.js @@ -250,7 +250,12 @@ function subredditRequest(subreddit) { req.onreadystatechange = function () { if (req.readyState === 4 && req.status === 200) { - let json = JSON.parse(req.responseText); + let json; + if (req.responseText) { + json = JSON.parse(req.responseText); + } else { + return "" + } let counter = 0;