Browse Source

Fixed sending requests with no options obj

pull/97/head
RogueException 9 years ago
parent
commit
1f5f443927
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      src/Discord.Net/Net/Queue/RestRequest.cs

+ 3
- 1
src/Discord.Net/Net/Queue/RestRequest.cs View File

@@ -35,13 +35,15 @@ namespace Discord.Net.Queue


private RestRequest(IRestClient client, string method, string endpoint, bool headerOnly, RequestOptions options) private RestRequest(IRestClient client, string method, string endpoint, bool headerOnly, RequestOptions options)
{ {
var timeout = options?.Timeout;

Client = client; Client = client;
Method = method; Method = method;
Endpoint = endpoint; Endpoint = endpoint;
Json = null; Json = null;
MultipartParams = null; MultipartParams = null;
HeaderOnly = headerOnly; HeaderOnly = headerOnly;
TimeoutTick = options.Timeout.HasValue ? (int?)unchecked(Environment.TickCount + options.Timeout.Value) : null;
TimeoutTick = timeout.HasValue ? (int?)unchecked(Environment.TickCount + timeout.Value) : null;
Promise = new TaskCompletionSource<Stream>(); Promise = new TaskCompletionSource<Stream>();
} }




Loading…
Cancel
Save