diff --git a/src/Discord.Net.WebSocket/DiscordSocketClient.cs b/src/Discord.Net.WebSocket/DiscordSocketClient.cs index 1353b583b..7a1aaa6d6 100644 --- a/src/Discord.Net.WebSocket/DiscordSocketClient.cs +++ b/src/Discord.Net.WebSocket/DiscordSocketClient.cs @@ -1234,7 +1234,7 @@ namespace Discord.WebSocket var data = (payload as JToken).ToObject(_serializer); var channel = State.GetChannel(data.ChannelId) as ISocketMessageChannel; - SocketUser author; + var guild = (channel as SocketGuildChannel)?.Guild; if (guild != null && !guild.IsSynced) { @@ -1255,6 +1255,7 @@ namespace Discord.WebSocket } } + SocketUser author; if (guild != null) { if (data.WebhookId.IsSpecified)