Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-3065

Although documented as @Nullable, passing a null filter to FindIterable#find throws a NullPointerException

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 3.9.1
    • Affects Version/s: 3.8.2
    • Component/s: API
    • None

      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)

       

       

            Assignee:
            ross@mongodb.com Ross Lawley
            Reporter:
            etay2000 Eric Tray
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: