summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOmar Roth <omarroth@hotmail.com>2018-08-07 10:01:46 -0500
committerOmar Roth <omarroth@hotmail.com>2018-08-07 10:01:46 -0500
commita5fb1d38e04298a6dfd8b4851052091db04d628f (patch)
treec69b7da930149998aaceda9b775dc0279c34ca84
parent187fa11c4afc9192575f822e1f127bbd0de57f4e (diff)
downloadinvidious-a5fb1d38e04298a6dfd8b4851052091db04d628f.tar.gz
invidious-a5fb1d38e04298a6dfd8b4851052091db04d628f.tar.bz2
invidious-a5fb1d38e04298a6dfd8b4851052091db04d628f.zip
Fix non-existent 'content_html' on empty comment section
-rw-r--r--src/invidious.cr5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/invidious.cr b/src/invidious.cr
index 30a27058..ce518a08 100644
--- a/src/invidious.cr
+++ b/src/invidious.cr
@@ -1708,7 +1708,12 @@ get "/api/v1/comments/:id" do |env|
ctoken = body.match(/'COMMENTS_TOKEN': "(?<ctoken>[^"]+)"/)
if !ctoken
env.response.content_type = "application/json"
+
+ if format == "json"
next {"comments" => [] of String}.to_json
+ else
+ next {"content_html" => ""}.to_json
+ end
end
ctoken = ctoken["ctoken"]
itct = body.match(/itct=(?<itct>[^"]+)"/).not_nil!["itct"]