mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2026-08-15 13:04:36 +00:00
Modernize null-check patterns: use 'is null' and 'is not null'
Replace '== null' with 'is null' and '!= null' with 'is not null' across 19 core files following modern C# pattern matching conventions. Only literal null comparisons are changed. Assignments, value comparisons, and LINQ expressions are left untouched. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
parent
902e944cbb
commit
c5df6a49c6
19 changed files with 111 additions and 111 deletions
|
|
@ -153,11 +153,11 @@ namespace MinecraftClient.ChatBots
|
|||
|
||||
private void Disconnect()
|
||||
{
|
||||
if (discordBotClient != null)
|
||||
if (discordBotClient is not null)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (discordChannel != null)
|
||||
if (discordChannel is not null)
|
||||
discordBotClient.SendMessageAsync(discordChannel, new DiscordEmbedBuilder
|
||||
{
|
||||
Description = Translations.bot_DiscordBridge_disconnected,
|
||||
|
|
@ -284,7 +284,7 @@ namespace MinecraftClient.ChatBots
|
|||
filePath = filePath[(filePath.IndexOf(Path.DirectorySeparatorChar) + 1)..];
|
||||
var messageBuilder = new DiscordMessageBuilder();
|
||||
|
||||
if (text != null)
|
||||
if (text is not null)
|
||||
messageBuilder.WithContent(text);
|
||||
|
||||
messageBuilder.AddFiles(new Dictionary<string, Stream>() { { filePath, fs } });
|
||||
|
|
@ -309,7 +309,7 @@ namespace MinecraftClient.ChatBots
|
|||
|
||||
private bool CanSendMessages()
|
||||
{
|
||||
return discordBotClient != null && discordChannel != null && bridgeDirection != BridgeDirection.Minecraft;
|
||||
return discordBotClient is not null && discordChannel is not null && bridgeDirection != BridgeDirection.Minecraft;
|
||||
}
|
||||
|
||||
async Task MainAsync()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue