Skip to content

Commit

Permalink
Merge pull request #14 from dassjosh/develop
Browse files Browse the repository at this point in the history
Add a null check to Channels and Threads in BotClient.GetChannel
  • Loading branch information
dassjosh authored Oct 24, 2024
2 parents 7bad5ba + 2fdab62 commit ce39d34
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Oxide.Ext.Discord/Clients/BotClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ public DiscordChannel GetChannel(Snowflake channelId, Snowflake? guildId)
DiscordGuild guild = GetGuild(guildId);
if (guild != null)
{
return guild.Channels[channelId] ?? guild.Threads[channelId];
return guild.Channels?[channelId] ?? guild.Threads?[channelId];
}

return null;
Expand Down

0 comments on commit ce39d34

Please sign in to comment.