From b5f79444f9c32dcd090c06e3bf48c1c0bb63bb22 Mon Sep 17 00:00:00 2001 From: Omar Roth Date: Tue, 21 Jul 2020 20:11:13 -0400 Subject: [PATCH] Fix optional value in data extractor --- src/invidious/helpers/helpers.cr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/invidious/helpers/helpers.cr b/src/invidious/helpers/helpers.cr index ca7c9ebc..cb4aec9b 100644 --- a/src/invidious/helpers/helpers.cr +++ b/src/invidious/helpers/helpers.cr @@ -326,7 +326,7 @@ def extract_items(initial_data : Hash(String, JSON::Any), author_fallback : Stri t["continuationContents"]? } .try { |t| t["sectionListRenderer"]? || t["sectionListContinuation"]? } .try &.["contents"].as_a - .each { |c| c.try &.["itemSectionRenderer"]["contents"].as_a + .each { |c| c.try &.["itemSectionRenderer"]?.try &.["contents"].as_a .try { |t| t[0]?.try &.["shelfRenderer"]?.try &.["content"]["expandedShelfContentsRenderer"]?.try &.["items"].as_a || t[0]?.try &.["gridRenderer"]?.try &.["items"].as_a || t } .each { |item|