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 )

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Blocker - P1 Blocker - P1
    • 2.6.5
    • Affects Version/s: 2.6.4
    • Component/s: None
    • Labels:
      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 Brendan W. McAdams
            Reporter:
            brendan Brendan W. McAdams
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: