From 7112f3579378808a709b389ed4549baf74f679b1 Mon Sep 17 00:00:00 2001 From: Samantaz Fox Date: Mon, 14 Feb 2022 21:54:26 +0100 Subject: [PATCH] comments: don't error out when video has no comments continuationItems is nil when video has no comments --- src/invidious/comments.cr | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/invidious/comments.cr b/src/invidious/comments.cr index 65f4b135..ab9fcc8b 100644 --- a/src/invidious/comments.cr +++ b/src/invidious/comments.cr @@ -78,7 +78,8 @@ def fetch_youtube_comments(id, cursor, format, locale, thin_mode, region, sort_b when "RELOAD_CONTINUATION_SLOT_HEADER" header = item["reloadContinuationItemsCommand"]["continuationItems"][0] when "RELOAD_CONTINUATION_SLOT_BODY" - contents = item["reloadContinuationItemsCommand"]["continuationItems"] + # continuationItems is nil when video has no comments + contents = item["reloadContinuationItemsCommand"]["continuationItems"]? end elsif item["appendContinuationItemsAction"]? contents = item["appendContinuationItemsAction"]["continuationItems"]