From 0e7191f8826bf1ee5dec38433aeef261c41aaf13 Mon Sep 17 00:00:00 2001 From: Kayra Uylar <52961639+kuylar@users.noreply.github.com> Date: Fri, 12 Jan 2024 10:48:57 +0300 Subject: [PATCH] Fix #111 (#114) * Fix #111 * But wait, there's more! --- LightTube/Contexts/ChannelContext.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/LightTube/Contexts/ChannelContext.cs b/LightTube/Contexts/ChannelContext.cs index f397d234..61202ca5 100644 --- a/LightTube/Contexts/ChannelContext.cs +++ b/LightTube/Contexts/ChannelContext.cs @@ -25,8 +25,8 @@ public ChannelContext(HttpContext context, ChannelTabs tab, InnerTubeChannelResp { Id = id; CurrentTab = tab; - BannerUrl = channel.Header?.Banner.Last().Url.ToString() ?? ""; - AvatarUrl = channel.Header?.Avatars.Last().Url.ToString() ?? ""; + BannerUrl = channel.Header?.Banner.LastOrDefault()?.Url.ToString(); + AvatarUrl = channel.Header?.Avatars.LastOrDefault()?.Url.ToString() ?? ""; ChannelTitle = channel.Header?.Title ?? ""; SubscriberCountText = channel.Header?.SubscriberCountText ?? ""; LightTubeAccount = false; @@ -68,7 +68,7 @@ public ChannelContext(HttpContext context, ChannelTabs tab, InnerTubeChannelResp { Id = id; CurrentTab = tab; - BannerUrl = channel.Header?.Banner.Last().Url.ToString() ?? ""; + BannerUrl = channel.Header?.Banner.LastOrDefault()?.Url.ToString(); AvatarUrl = channel.Header?.Avatars.Last().Url.ToString() ?? ""; ChannelTitle = channel.Header?.Title ?? ""; SubscriberCountText = channel.Header?.SubscriberCountText ?? "";