API: handle related channels parsing exceptions

This commit is contained in:
Samantaz Fox 2022-02-07 00:52:18 +01:00
parent 1668e4187e
commit 698a6f3886
No known key found for this signature in database
GPG key ID: F42821059186176E

View file

@ -97,7 +97,11 @@ module Invidious::Routes::API::V1::Channels
json.field "relatedChannels" do json.field "relatedChannels" do
json.array do json.array do
# Fetch related channels # Fetch related channels
begin
related_channels = fetch_related_channels(channel) related_channels = fetch_related_channels(channel)
rescue ex
related_channels = [] of AboutRelatedChannel
end
related_channels.each do |related_channel| related_channels.each do |related_channel|
json.object do json.object do