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)
|
public CommandContext(IDiscordClient client, IUserMessage msg)
|
||||||
{
|
{
|
||||||
Client = client;
|
Client = client;
|
||||||
Guild = (msg.Channel as IGuildChannel).Guild;
|
Guild = (msg.Channel as IGuildChannel)?.Guild;
|
||||||
Channel = msg.Channel;
|
Channel = msg.Channel;
|
||||||
User = msg.Author;
|
User = msg.Author;
|
||||||
Message = msg;
|
Message = msg;
|
||||||
|
|||||||
Reference in New Issue
Block a user