mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2025-05-23 11:16:59 -04:00
Fix nullref in HTTP retry policy
This commit is contained in:
parent
56df93305e
commit
91ba79e6ec
1 changed files with 3 additions and 2 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue