Browse Source

Don't crash if we get an unknown user from CreatePMChannel

tags/docs-0.9
RogueException 9 years ago
parent
commit
44d16f73e4
1 changed files with 2 additions and 0 deletions
  1. +2
    -0
      src/Discord.Net/DiscordClient.API.cs

+ 2
- 0
src/Discord.Net/DiscordClient.API.cs View File

@@ -99,6 +99,8 @@ namespace Discord
if (channel == null)
{
var response = await _api.CreatePMChannel(CurrentUserId, userId).ConfigureAwait(false);
user = _users.GetOrAdd(response.Recipient?.Id);
user.Update(response.Recipient);
channel = _channels.GetOrAdd(response.Id, response.GuildId, response.Recipient?.Id);
channel.Update(response);
}


Loading…
Cancel
Save