Browse Source

Prevent NullReferenceException if ParentChannel not set.

Similar call stack to #824.
pull/2516/head
Cool-Man 2 years ago
parent
commit
231518d171
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      src/Discord.Net.WebSocket/Entities/Channels/SocketThreadChannel.cs

+ 2
- 2
src/Discord.Net.WebSocket/Entities/Channels/SocketThreadChannel.cs View File

@@ -315,14 +315,14 @@ namespace Discord.WebSocket
/// <b>This method is not supported in threads.</b>
/// </remarks>
public override OverwritePermissions? GetPermissionOverwrite(IRole role)
=> ParentChannel.GetPermissionOverwrite(role);
=> ParentChannel?.GetPermissionOverwrite(role);

/// <inheritdoc/>
/// <remarks>
/// <b>This method is not supported in threads.</b>
/// </remarks>
public override OverwritePermissions? GetPermissionOverwrite(IUser user)
=> ParentChannel.GetPermissionOverwrite(user);
=> ParentChannel?.GetPermissionOverwrite(user);

/// <inheritdoc/>
/// <remarks>


Loading…
Cancel
Save