mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2026-01-29 06:10:54 +00:00
Skip invalid reactions instead of crashing (#1227)
This commit is contained in:
@@ -676,10 +676,14 @@ public class DiscordClient(string token)
|
||||
.SetQueryParameter("after", currentAfter.ToString())
|
||||
.Build();
|
||||
|
||||
var response = await GetJsonResponseAsync(url, cancellationToken);
|
||||
// Can be null on reactions with an emoji that has been deleted (?)
|
||||
// https://github.com/Tyrrrz/DiscordChatExporter/issues/1226
|
||||
var response = await TryGetJsonResponseAsync(url, cancellationToken);
|
||||
if (response is null)
|
||||
yield break;
|
||||
|
||||
var count = 0;
|
||||
foreach (var userJson in response.EnumerateArray())
|
||||
foreach (var userJson in response.Value.EnumerateArray())
|
||||
{
|
||||
var user = User.Parse(userJson);
|
||||
yield return user;
|
||||
|
||||
Reference in New Issue
Block a user