From cca07b48b18b3bd89df246c1cbbd40581991eb29 Mon Sep 17 00:00:00 2001 From: "Admiral H. Curtiss" Date: Thu, 14 Nov 2024 19:45:18 +0100 Subject: [PATCH] Add null check for emoticon id in TwitchHelper.GetEmotes() (#1254) --- TwitchDownloaderCore/TwitchHelper.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/TwitchDownloaderCore/TwitchHelper.cs b/TwitchDownloaderCore/TwitchHelper.cs index a3816eef..fb3871d0 100644 --- a/TwitchDownloaderCore/TwitchHelper.cs +++ b/TwitchDownloaderCore/TwitchHelper.cs @@ -541,6 +541,11 @@ public static async Task> GetEmotes(List comments, st .Select(f => f.emoticon?.emoticon_id) .Where(id => !alreadyAdded.Contains(id) && !failedEmotes.Contains(id))) { + if (id == null) + { + continue; + } + try { byte[] bytes = await GetImage(emoteFolder, $"https://static-cdn.jtvnw.net/emoticons/v2/{id}/default/dark/2.0", id, 2, "png", logger, cancellationToken);