fix: #1421 (in a better way) Return empty set when ActiveClients is null (#1422)

This change ensures that SocketUser.ActiveClients will not return null, but instead an empty set by default. This can happen if the client has not recieved a presence update for a user, or if the user is not cached.
This commit is contained in:
Chris Johnston
2019-11-23 09:58:13 -08:00
committed by Christopher F
parent 911523d56f
commit 3ff4e3d506

View File

@@ -40,7 +40,7 @@ namespace Discord.WebSocket
/// <inheritdoc />
public UserStatus Status => Presence.Status;
/// <inheritdoc />
public IImmutableSet<ClientType> ActiveClients => Presence.ActiveClients;
public IImmutableSet<ClientType> ActiveClients => Presence.ActiveClients ?? ImmutableHashSet<ClientType>.Empty;
/// <summary>
/// Gets mutual guilds shared with this user.
/// </summary>