Skip to content

Commit 4abfe7c

Browse files
authored
Use ArgumentNullException.ThrowIfNull in a few more places (#70897)
1 parent cae8546 commit 4abfe7c

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/libraries/System.DirectoryServices/src/System/DirectoryServices/ActiveDirectory/ActiveDirectorySchemaProperty.cs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,7 @@ public ActiveDirectorySchemaProperty(DirectoryContext context, string ldapDispla
118118
}
119119
}
120120

121-
if (ldapDisplayName == null)
122-
{
123-
throw new ArgumentNullException(nameof(ldapDisplayName));
124-
}
121+
ArgumentNullException.ThrowIfNull(ldapDisplayName);
125122

126123
if (ldapDisplayName.Length == 0)
127124
{
@@ -294,10 +291,7 @@ public static ActiveDirectorySchemaProperty FindByName(DirectoryContext context,
294291
}
295292
}
296293

297-
if (ldapDisplayName == null)
298-
{
299-
throw new ArgumentNullException(nameof(ldapDisplayName));
300-
}
294+
ArgumentNullException.ThrowIfNull(ldapDisplayName);
301295

302296
if (ldapDisplayName.Length == 0)
303297
{

0 commit comments

Comments
 (0)