From 95bde7bb8ae8f90266f9c2dabd06d0fcea6e63f6 Mon Sep 17 00:00:00 2001 From: Omar Roth Date: Sun, 20 Jan 2019 09:56:54 -0600 Subject: [PATCH] Add handling for empty continuation --- 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 a5ea012c..87065b5f 100644 --- a/src/invidious/comments.cr +++ b/src/invidious/comments.cr @@ -227,7 +227,8 @@ def fetch_youtube_comments(id, continuation, proxies, format, locale) reply_count ||= 1 end - continuation = node_replies["continuations"].as_a[0]["nextContinuationData"]["continuation"].as_s + continuation = node_replies["continuations"]?.try &.as_a[0]["nextContinuationData"]["continuation"].as_s + continuation ||= "" json.field "replies" do json.object do