Use ArgumentNullException.ThrowIfNull in a few more places (#70897)
authorStephen Toub <stoub@microsoft.com>
Sat, 18 Jun 2022 00:36:47 +0000 (20:36 -0400)
committerGitHub <noreply@github.com>
Sat, 18 Jun 2022 00:36:47 +0000 (20:36 -0400)
src/libraries/System.DirectoryServices/src/System/DirectoryServices/ActiveDirectory/ActiveDirectorySchemaProperty.cs

index cce6a59..fb6efff 100644 (file)
@@ -118,10 +118,7 @@ namespace System.DirectoryServices.ActiveDirectory
                 }
             }
 
-            if (ldapDisplayName == null)
-            {
-                throw new ArgumentNullException(nameof(ldapDisplayName));
-            }
+            ArgumentNullException.ThrowIfNull(ldapDisplayName);
 
             if (ldapDisplayName.Length == 0)
             {
@@ -294,10 +291,7 @@ namespace System.DirectoryServices.ActiveDirectory
                 }
             }
 
-            if (ldapDisplayName == null)
-            {
-                throw new ArgumentNullException(nameof(ldapDisplayName));
-            }
+            ArgumentNullException.ThrowIfNull(ldapDisplayName);
 
             if (ldapDisplayName.Length == 0)
             {