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

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Blocker - P1
    • 2.6.5
    • Affects Version/s: 2.6.4
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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.

              Assignee:
              Brendan W. McAdams (Inactive)
              Reporter:
              Brendan W. McAdams (Inactive)
              None
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: