Skip to content

Commit

Permalink
Add null check for emoticon id in TwitchHelper.GetEmotes() (#1254)
Browse files Browse the repository at this point in the history
  • Loading branch information
AdmiralCurtiss committed Nov 14, 2024
1 parent d42d70b commit cca07b4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions TwitchDownloaderCore/TwitchHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,11 @@ public static async Task<List<TwitchEmote>> GetEmotes(List<Comment> 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);
Expand Down

0 comments on commit cca07b4

Please sign in to comment.