Add a missing null-conditional in CommandContext#ctor

Prevents an NRE when creating a CommandContext from a message in an IDMChannel
This commit is contained in:
Christopher F
2016-10-16 16:25:10 -04:00
parent c813a049ff
commit 11f4dc0d10

View File

@@ -21,7 +21,7 @@
public CommandContext(IDiscordClient client, IUserMessage msg)
{
Client = client;
Guild = (msg.Channel as IGuildChannel).Guild;
Guild = (msg.Channel as IGuildChannel)?.Guild;
Channel = msg.Channel;
User = msg.Author;
Message = msg;