Skip to content

Commit 667768f

Browse files
committed
added VB unit tests and fixed a bug in predicate translator.
1 parent 6c76b8a commit 667768f

File tree

3 files changed

+476
-1
lines changed

3 files changed

+476
-1
lines changed

Driver/Linq/Translators/PredicateTranslator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ private IMongoQuery BuildContainsKeyQuery(MethodCallExpression methodCallExpress
460460
private IMongoQuery BuildContainsQuery(MethodCallExpression methodCallExpression)
461461
{
462462
// handle IDictionary Contains the same way as IDictionary<TKey, TValue> ContainsKey
463-
if (typeof(IDictionary).IsAssignableFrom(methodCallExpression.Object.Type))
463+
if (methodCallExpression.Object != null && typeof(IDictionary).IsAssignableFrom(methodCallExpression.Object.Type))
464464
{
465465
return BuildContainsKeyQuery(methodCallExpression);
466466
}

DriverUnitTestsVB/DriverUnitTestsVB.vbproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@
6969
<ItemGroup>
7070
<Compile Include="Linq\MongoQueryableTests.vb" />
7171
<Compile Include="Linq\MongoQueryProviderTests.vb" />
72+
<Compile Include="Linq\SelectDictionaryTests.vb" />
7273
<Compile Include="Linq\SelectNullableTests.vb" />
7374
<Compile Include="Linq\SelectOfTypeHierarchicalTests.vb" />
7475
<Compile Include="Linq\SelectOfTypeTests.vb" />

0 commit comments

Comments
 (0)