Add handling for empty continuation

This commit is contained in:
Omar Roth 2019-01-20 09:56:54 -06:00
parent daa2329f8b
commit 95bde7bb8a
1 changed files with 2 additions and 1 deletions

View File

@ -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