From 4991f2f892e226ab9200d3c3cccd1d13c4854080 Mon Sep 17 00:00:00 2001 From: RoosterDragon Date: Sun, 19 Feb 2023 11:59:16 +0000 Subject: [PATCH] Fix IDE0041 --- .editorconfig | 3 +++ OpenRA.Mods.Common/Traits/World/EditorActorPreview.cs | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) 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;