Remove dead code null check from DirectoryEntry (dotnet/corefx#41843)
authorRoman Marusyk <Marusyk@users.noreply.github.com>
Mon, 21 Oct 2019 15:10:02 +0000 (17:10 +0200)
committerStephen Toub <stoub@microsoft.com>
Mon, 21 Oct 2019 15:10:02 +0000 (11:10 -0400)
* Fix possible NRE in DirectoryEntry from System.DirectoryServices

* Update DirectoryEntry.cs

Commit migrated from https://github.com/dotnet/corefx/commit/c037aa0c71b4cd3d506aab843997ca06ce390c3a

src/libraries/System.DirectoryServices/src/System/DirectoryServices/DirectoryEntry.cs

index 54fd46e..5878a7a 100644 (file)
@@ -1001,7 +1001,7 @@ namespace System.DirectoryServices
             // this is a half-lie, but oh well. Without it, this method is pointless.
             _cacheFilled = true;
             // we need to partially refresh that properties table.
-            if (_propertyCollection != null && propertyNames != null)
+            if (_propertyCollection != null)
             {
                 for (int i = 0; i < propertyNames.Length; i++)
                 {