Skip to content

Commit

Permalink
Fixed nasty bug, due to null value in the properties that were send t…
Browse files Browse the repository at this point in the history
…o the DirectorySearcher.
  • Loading branch information
Lakritzator committed Feb 9, 2016
1 parent f6102f7 commit 677feed
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Dapplo.ActiveDirectory/ActiveDirectoryExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -190,10 +190,10 @@ private static IEnumerable<T> Execute<T>(string query, string domain = null) whe
/// Create a map for properties & the property name from the AD
/// </summary>
/// <param name="typeToFill"></param>
/// <returns></returns>
/// <returns>ILookup with for each found property (key) an IEnumerable with PropertyInfo objects</returns>
private static ILookup<string, PropertyInfo> ProcessType(Type typeToFill)
{
return typeToFill.GetProperties().Select(x => new KeyValuePair<string, PropertyInfo>(ReadAdProperty(x), x)).ToLookup(x=> x.Key, x=> x.Value);
return typeToFill.GetProperties().Select(x => new KeyValuePair<string, PropertyInfo>(ReadAdProperty(x), x)).Where(x=> x.Key != null).ToLookup(x=> x.Key, x=> x.Value);
}

/// <summary>
Expand Down

0 comments on commit 677feed

Please sign in to comment.