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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user