diff --git a/.editorconfig b/.editorconfig index 2b81b39a30..520a799f94 100644 --- a/.editorconfig +++ b/.editorconfig @@ -171,6 +171,9 @@ dotnet_diagnostic.IDE0036.severity = warning # Raise a warning on build when default access modifiers are explicitly specified. dotnet_diagnostic.IDE0040.severity = warning +# Use 'is null' check. +dotnet_diagnostic.IDE0041.severity = warning + # Make field readonly. dotnet_diagnostic.IDE0044.severity = warning diff --git a/OpenRA.Mods.Common/Traits/World/EditorActorPreview.cs b/OpenRA.Mods.Common/Traits/World/EditorActorPreview.cs index d0ecbad012..213c46d6e5 100644 --- a/OpenRA.Mods.Common/Traits/World/EditorActorPreview.cs +++ b/OpenRA.Mods.Common/Traits/World/EditorActorPreview.cs @@ -274,7 +274,7 @@ namespace OpenRA.Mods.Common.Traits public bool Equals(EditorActorPreview other) { - if (ReferenceEquals(null, other)) + if (other is null) return false; if (ReferenceEquals(this, other)) return true; @@ -284,7 +284,7 @@ namespace OpenRA.Mods.Common.Traits public override bool Equals(object obj) { - if (ReferenceEquals(null, obj)) + if (obj is null) return false; if (ReferenceEquals(this, obj)) return true;