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

This commit is contained in:
RogueException
2015-10-06 16:52:15 -03:00
parent 567588b4c6
commit 44d16f73e4

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