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

Java Driver 2.6.4 findOne fails when fields are specified but no document is found ( NullPointerException )

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Blocker - P1 Blocker - P1
    • 2.6.5
    • 2.6.4
    • None
    • None

    Description

      This is caused by the fix for JAVA-387 ( https://github.com/mongodb/mongo-java-driver/commit/3aee72f1cf814bcbc786a2e04dbce12a81f4cc14 ).

      The ternary operator explicitly declares "DBObject obj" as null if no matching document is found, but then with no test attempts to markAsPartialObject which will always throw a NullPointerException in the event findOne() found no matching document.

      Attachments

        Activity

          People

            brendan Brendan W. McAdams
            brendan Brendan W. McAdams
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: