mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2026-02-02 08:09:16 +00:00
Fix nullref in HTTP retry policy
This commit is contained in:
@@ -39,8 +39,9 @@ public static class Http
|
||||
8,
|
||||
(i, result, _) =>
|
||||
{
|
||||
// If rate-limited, use retry-after header as the guide
|
||||
if (result.Result.Headers.RetryAfter?.Delta is { } retryAfter)
|
||||
// If rate-limited, use retry-after header as the guide.
|
||||
// The response can be null here if an exception was thrown.
|
||||
if (result.Result?.Headers.RetryAfter?.Delta is { } retryAfter)
|
||||
{
|
||||
// Add some buffer just in case
|
||||
return retryAfter + TimeSpan.FromSeconds(1);
|
||||
|
||||
Reference in New Issue
Block a user