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

NullPointerException using Document#getList where the BSON array contains null elements

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • 4.8.2
    • None
    • BSON
    • None
    • Minor Change
    • Not Needed

    Description

      Please add Null check while in the values while using constructValuesList method

      Caused by: java.lang.NullPointerException: null
          at org.bson.Document.constructValuesList(Document.java:381)
          at org.bson.Document.getList(Document.java:349)
       

      null check for item. PFA 

       

       

      Sample input which causes the exception  

        "skills" : [ 
              "SQL"
              "null"
              "null"
              "null"
              "null"
              null
              null
              null
              null
              null
          ]
      
      

      Attachments

        Activity

          People

            jeff.yemin@mongodb.com Jeffrey Yemin
            jaspaljessy@gmail.com Jaspal Jessy
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: