From 698a6f38863c399b50cda27b5b509be2980e8a21 Mon Sep 17 00:00:00 2001 From: Samantaz Fox Date: Mon, 7 Feb 2022 00:52:18 +0100 Subject: [PATCH] API: handle related channels parsing exceptions --- src/invidious/routes/api/v1/channels.cr | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/invidious/routes/api/v1/channels.cr b/src/invidious/routes/api/v1/channels.cr index 83c6db04..c4d6643a 100644 --- a/src/invidious/routes/api/v1/channels.cr +++ b/src/invidious/routes/api/v1/channels.cr @@ -97,7 +97,11 @@ module Invidious::Routes::API::V1::Channels json.field "relatedChannels" do json.array do # Fetch related channels - related_channels = fetch_related_channels(channel) + begin + related_channels = fetch_related_channels(channel) + rescue ex + related_channels = [] of AboutRelatedChannel + end related_channels.each do |related_channel| json.object do