Browse Source

Fix #1421 (in a better way) Return empty set when ActiveClients is null

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.
pull/1422/head
Chris Johnston 5 years ago
parent
commit
14e9f5dd3c
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      src/Discord.Net.WebSocket/Entities/Users/SocketUser.cs

+ 1
- 1
src/Discord.Net.WebSocket/Entities/Users/SocketUser.cs View File

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


Loading…
Cancel
Save