From e3af3988b9e5b384d57b57d79d14c1a9217ed4b1 Mon Sep 17 00:00:00 2001 From: Brandon Smith Date: Tue, 1 Sep 2015 19:31:30 -0300 Subject: [PATCH] Don't crash when null config is passed to DiscordClient --- src/Discord.Net/DiscordClient.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Discord.Net/DiscordClient.cs b/src/Discord.Net/DiscordClient.cs index 5a9399569..4d639775d 100644 --- a/src/Discord.Net/DiscordClient.cs +++ b/src/Discord.Net/DiscordClient.cs @@ -59,7 +59,7 @@ namespace Discord { _blockEvent = new ManualResetEventSlim(true); _config = config ?? new DiscordClientConfig(); - _isDebugMode = config.EnableDebug; + _isDebugMode = _config.EnableDebug; _rand = new Random(); _serializer = new JsonSerializer(); @@ -92,14 +92,14 @@ namespace Discord if (_config.UseMessageQueue) _pendingMessages = new ConcurrentQueue(); - _http = new JsonHttpClient(config.EnableDebug); + _http = new JsonHttpClient(_config.EnableDebug); _api = new DiscordAPI(_http); if (_isDebugMode) _http.OnDebugMessage += (s, e) => RaiseOnDebugMessage(e.Type, e.Message); CreateCaches(); - _webSocket = new DiscordDataSocket(this, config.ConnectionTimeout, config.WebSocketInterval, config.EnableDebug); + _webSocket = new DiscordDataSocket(this, _config.ConnectionTimeout, _config.WebSocketInterval, _config.EnableDebug); _webSocket.Connected += (s, e) => RaiseConnected(); _webSocket.Disconnected += async (s, e) => {