[JAVA-3065] Although documented as @Nullable, passing a null filter to FindIterable#find throws a NullPointerException Created: 05/Nov/18  Updated: 28/Oct/23  Resolved: 09/Nov/18

Status: Closed
Project: Java Driver
Component/s: API
Affects Version/s: 3.8.2
Fix Version/s: 3.9.1

Type: Bug Priority: Major - P3
Reporter: Eric Tray Assignee: Ross Lawley
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Although documented (https://mongodb.github.io/mongo-java-driver/3.5/javadoc/com/mongodb/async/client/FindIterable.html#filter-org.bson.conversions.Bson-) as @Nullable, passing a null filter to FindIterable#find causes a NullPointerException to be thrown:

 

at com.mongodb.internal.operation.Operations.createFindOperation(Operations.java:141)
at com.mongodb.internal.operation.Operations.find(Operations.java:129)
at com.mongodb.internal.operation.AsyncOperations.find(AsyncOperations.java:84)
at com.mongodb.async.client.FindIterableImpl.createFindOperation(FindIterableImpl.java:228)
at com.mongodb.async.client.FindIterableImpl.asAsyncReadOperation(FindIterableImpl.java:224)
at com.mongodb.async.client.MongoIterableImpl.batchCursor(MongoIterableImpl.java:161)
at com.mongodb.async.client.MongoIterableSubscription.requestInitialData(MongoIterableSubscription.java:46)
at com.mongodb.async.client.AbstractSubscription.tryRequestInitialData(AbstractSubscription.java:151)
at com.mongodb.async.client.AbstractSubscription.request(AbstractSubscription.java:84)

 

 



 Comments   
Comment by Githook User [ 07/Nov/18 ]

Author:

{'name': 'Ross Lawley', 'email': 'ross.lawley@gmail.com', 'username': 'rozza'}

Message: Ensure FindIterable.filter can handle nullable input

JAVA-3065
Branch: 3.9.x
https://github.com/mongodb/mongo-java-driver/commit/77bddd6b3fd3f2c2d6fd31998d1f094a730466ec

Comment by Githook User [ 07/Nov/18 ]

Author:

{'name': 'Ross Lawley', 'email': 'ross.lawley@gmail.com', 'username': 'rozza'}

Message: Ensure FindIterable.filter can handle nullable input

JAVA-3065
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/efcc79bd60bfdfa6d62588c3e0dd2afe526fd4c6

Comment by Ross Lawley [ 07/Nov/18 ]

Thanks etay2000 for the ticket, that looks like a regression.

Generated at Thu Feb 08 08:58:42 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.