From ad5c2f687df642f35955efe647198a0cc09334ba Mon Sep 17 00:00:00 2001
From: vexx32 <32407840+vexx32@users.noreply.github.com>
Date: Thu, 10 Oct 2019 22:04:49 -0400
Subject: [PATCH] :sparkles: :recycle: Cleanup IsNull / IsNullLike
---
src/System.Management.Automation/engine/LanguagePrimitives.cs | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/System.Management.Automation/engine/LanguagePrimitives.cs b/src/System.Management.Automation/engine/LanguagePrimitives.cs
index 618a23b9f51..82a11de87dd 100644
--- a/src/System.Management.Automation/engine/LanguagePrimitives.cs
+++ b/src/System.Management.Automation/engine/LanguagePrimitives.cs
@@ -1063,7 +1063,7 @@ internal static bool IsTrue(IList objectArray)
///
/// The object to test.
/// True if the object is null.
- public static bool IsNull(object obj) => obj == null || obj == AutomationNull.Value;
+ public static bool IsNull(object obj) => obj is null || obj == AutomationNull.Value;
///
/// Internal routine that determines if an object meets any of our criteria for null.
@@ -1071,7 +1071,7 @@ internal static bool IsTrue(IList objectArray)
///
/// The object to test.
/// True if the object is null.
- public static bool IsNullLike(object obj) => obj == DBNull.Value || obj == NullString.Value || IsNull(obj);
+ public static bool IsNullLike(object obj) => IsNull(obj) || obj == DBNull.Value || obj == NullString.Value;
///
/// Auxiliary for the cases where we want a new PSObject or null.