Give private users a proper ID.

This commit is contained in:
RogueException
2015-10-24 22:37:14 -03:00
parent 98b64ced73
commit 1ed853da42
2 changed files with 2 additions and 2 deletions

View File

@@ -10,7 +10,7 @@ namespace Discord
public Members(DiscordClient client, object writerLock)
: base(client, writerLock, x => x.OnCached(), x => x.OnUncached()) { }
private string GetKey(string userId, string serverId)
=> serverId + '_' + userId;
=> (serverId ?? "Private") + '_' + userId;
public User this[string userId, string serverId]
=> this[GetKey(userId, serverId)];

View File

@@ -549,7 +549,7 @@ namespace Discord
var channel = _channels[data.ChannelId];
if (channel != null)
{
var user = _members[data.UserId, channel.Server.Id];
var user = _members[data.UserId, channel.Server?.Id];
if (user != null)
{