Skip to content

Commit af1a89f

Browse files
[System.DirectoryServices] Fixed possible NRE in ADStoreCtx_Query.cs (#118122)
* [System.DirectoryServices] Fixed possible NRE in ADStoreCtx_Query.cs qbeFilter may well have a null value if you create an instance of PrincipalSearcher using the PrincipalSearcher() constructor. * Remove trailing whitespace --------- Co-authored-by: Jeff Handley <jeffhandley@users.noreply.github.com>
1 parent 7eaf6c4 commit af1a89f

File tree

1 file changed

+5
-5
lines changed
  • src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AD

1 file changed

+5
-5
lines changed

src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AD/ADStoreCtx_Query.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -171,12 +171,12 @@ internal override object PushFilterToNativeSearcher(PrincipalSearcher ps)
171171
// Wrap off the filter
172172
//
173173
ldapFilter.Append(')');
174-
}
175174

176-
// We don't need any attributes returned, since we're just going to get a DirectoryEntry
177-
// for the result. Per RFC 2251, OID 1.1 == no attributes.
178-
//ds.PropertiesToLoad.Add("1.1");
179-
BuildPropertySet(qbeFilter.GetType(), ds.PropertiesToLoad);
175+
// We don't need any attributes returned, since we're just going to get a DirectoryEntry
176+
// for the result. Per RFC 2251, OID 1.1 == no attributes.
177+
//ds.PropertiesToLoad.Add("1.1");
178+
BuildPropertySet(qbeFilter.GetType(), ds.PropertiesToLoad);
179+
}
180180

181181
ds.Filter = ldapFilter.ToString();
182182
GlobalDebug.WriteLineIf(GlobalDebug.Info, "ADStoreCtx", "PushFilterToNativeSearcher: using LDAP filter {0}", ds.Filter);

0 commit comments

Comments
 (0)