Skip to content

Commit

Permalink
Fix NRE with presence activities (DSharpPlus#1214)
Browse files Browse the repository at this point in the history
  • Loading branch information
MichailiK authored Feb 18, 2022
1 parent 9a21d7f commit f467726
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions DSharpPlus/Entities/User/DiscordPresence.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,10 @@ internal DiscordPresence() { }
internal DiscordPresence(DiscordPresence other)
{
this.Discord = other.Discord;
this.Activity = new DiscordActivity(other.Activity);
this.RawActivity = new TransportActivity(this.Activity);
if (other.Activity != null)
this.Activity = new DiscordActivity(other.Activity);
if (other.Activity != null)
this.RawActivity = new TransportActivity(this.Activity);
this._internalActivities = (DiscordActivity[])other._internalActivities?.Clone();
this.RawActivities = (TransportActivity[])other.RawActivities?.Clone();
this.Status = other.Status;
Expand Down

0 comments on commit f467726

Please sign in to comment.