Skip to content

Commit

Permalink
fix: wrong dispose usage
Browse files Browse the repository at this point in the history
  • Loading branch information
Lulalaby committed Dec 23, 2023
1 parent 831f3b6 commit e294a52
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions DisCatSharp/Clients/DiscordClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1488,7 +1488,7 @@ private DiscordUser UpdateUser(DiscordUser usr, ulong? guildId, DiscordGuild? gu
/// <param name="rawEvents">The raw events.</param>
private void UpdateCachedScheduledEvent(DiscordGuild guild, JArray? rawEvents)
{
ObjectDisposedException.ThrowIf(true, this._disposed);
ObjectDisposedException.ThrowIf(this._disposed, this);

if (rawEvents is not null)
{
Expand All @@ -1512,7 +1512,7 @@ private void UpdateCachedScheduledEvent(DiscordGuild guild, JArray? rawEvents)
/// <param name="rawMembers">The raw members.</param>
private void UpdateCachedGuild(DiscordGuild newGuild, JArray? rawMembers)
{
ObjectDisposedException.ThrowIf(true, this._disposed);
ObjectDisposedException.ThrowIf(this._disposed, this);

this.GuildsInternal.TryAdd(newGuild.Id, newGuild);

Expand Down Expand Up @@ -1685,7 +1685,7 @@ private void PopulateMessageReactionsAndCache(DiscordMessage message, TransportU
/// </summary>
public override void Dispose()
{
ObjectDisposedException.ThrowIf(true, this._disposed);
ObjectDisposedException.ThrowIf(this._disposed, this);

this._disposed = true;
GC.SuppressFinalize(this);
Expand Down

0 comments on commit e294a52

Please sign in to comment.