mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2026-05-01 02:02:22 +00:00
Fix nullref in HTTP retry policy
This commit is contained in:
@@ -39,8 +39,9 @@ public static class Http
|
|||||||
8,
|
8,
|
||||||
(i, result, _) =>
|
(i, result, _) =>
|
||||||
{
|
{
|
||||||
// If rate-limited, use retry-after header as the guide
|
// If rate-limited, use retry-after header as the guide.
|
||||||
if (result.Result.Headers.RetryAfter?.Delta is { } retryAfter)
|
// 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
|
// Add some buffer just in case
|
||||||
return retryAfter + TimeSpan.FromSeconds(1);
|
return retryAfter + TimeSpan.FromSeconds(1);
|
||||||
|
|||||||
Reference in New Issue
Block a user