Fixed sending requests with no options obj

This commit is contained in:
RogueException
2016-06-07 21:19:49 -03:00
parent 559b89933f
commit 1f5f443927

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>();
} }