Browse Source

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.
tags/2.2.0
Chris Johnston Christopher F 5 years ago
parent
commit
3ff4e3d506
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 />
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>


Loading…
Cancel
Save