From 493a94cfaa7b109a99f54dd02567e486d4cda1e9 Mon Sep 17 00:00:00 2001 From: Kayra Uylar <52961639+kuylar@users.noreply.github.com> Date: Mon, 29 Jan 2024 21:45:37 +0300 Subject: [PATCH] Fix nullref in feeds (#125) --- LightTube/YoutubeRSS.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/LightTube/YoutubeRSS.cs b/LightTube/YoutubeRSS.cs index b06a214e..fd3a47fc 100644 --- a/LightTube/YoutubeRSS.cs +++ b/LightTube/YoutubeRSS.cs @@ -30,7 +30,7 @@ public static async Task GetChannelFeed(string channelId) try { InnerTubeChannelResponse response = await _innerTube.GetChannelAsync(channelId, ChannelTabs.Videos); - DateTimeOffset reference = new(DateTime.Today); + DateTimeOffset reference = DateTimeOffset.Now; List videos = new(); foreach (IRenderer renderer in response.Contents.Select(x => @@ -65,7 +65,8 @@ public static async Task GetChannelFeed(string channelId) return new ChannelFeed { Name = "Failed to get videos for channel " + channelId, - Id = channelId + Id = channelId, + Videos = Array.Empty() }; } }