Changed all == null to is null and all !(* == null) to * is not null

This commit is contained in:
Kwoth
2021-06-19 08:24:09 +02:00
parent 81406cb46a
commit d8c7cdc7f4
125 changed files with 367 additions and 366 deletions

View File

@@ -152,7 +152,7 @@ namespace NadekoBot.Extensions
public static void ThrowIfNull<T>(this T o, string name) where T : class
{
if (o == null)
if (o is null)
throw new ArgumentNullException(nameof(name));
}
@@ -194,7 +194,7 @@ namespace NadekoBot.Extensions
public static ReactionEventWrapper OnReaction(this IUserMessage msg, DiscordSocketClient client, Func<SocketReaction, Task> reactionAdded, Func<SocketReaction, Task> reactionRemoved = null)
{
if (reactionRemoved == null)
if (reactionRemoved is null)
reactionRemoved = _ => Task.CompletedTask;
var wrap = new ReactionEventWrapper(client, msg);
@@ -348,7 +348,7 @@ namespace NadekoBot.Extensions
public static long? GetImageSize(this HttpResponseMessage msg)
{
if (msg.Content.Headers.ContentLength == null)
if (msg.Content.Headers.ContentLength is null)
{
return null;
}
@@ -381,7 +381,7 @@ namespace NadekoBot.Extensions
.Where(x => x.GetInterfaces().Contains(typeof(INService))
&& !x.GetTypeInfo().IsInterface && !x.GetTypeInfo().IsAbstract
#if GLOBAL_NADEKO
&& x.GetTypeInfo().GetCustomAttribute<NoPublicBotAttribute>() == null
&& x.GetTypeInfo().GetCustomAttribute<NoPublicBotAttribute>() is null
#endif
)
.ToArray());