Browse Source

Fixed null GameTypes

pull/73/merge
RogueException 9 years ago
parent
commit
14180fb761
3 changed files with 3 additions and 4 deletions
  1. +1
    -1
      src/Discord.Net/API/Client/Common/Game.cs
  2. +1
    -1
      src/Discord.Net/Models/User.cs
  3. +1
    -2
      src/Discord.Net/Net/WebSockets/BuiltInEngine.cs

+ 1
- 1
src/Discord.Net/API/Client/Common/Game.cs View File

@@ -9,6 +9,6 @@ namespace Discord.API.Client
[JsonProperty("url")]
public string Url { get; set; }
[JsonProperty("type")]
public GameType Type { get; set; }
public GameType? Type { get; set; }
}
}

+ 1
- 1
src/Discord.Net/Models/User.cs View File

@@ -211,7 +211,7 @@ namespace Discord
}

if (model.Game != null)
CurrentGame = new Game(model.Game.Name, model.Game.Type, model.Game.Url);
CurrentGame = new Game(model.Game.Name, model.Game.Type ?? GameType.Default, model.Game.Url);
else
CurrentGame = null;
}


+ 1
- 2
src/Discord.Net/Net/WebSockets/BuiltInEngine.cs View File

@@ -51,8 +51,7 @@ namespace Discord.Net.WebSockets
{
string ignored;
while (_sendQueue.TryDequeue(out ignored)) { }

var socket = _webSocket;
_webSocket = null;

return TaskHelper.CompletedTask;


Loading…
Cancel
Save