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

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

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.8.2
    • Affects Version/s: None
    • Component/s: BSON
    • Labels:
      None
    • Minor Change
    • Not Needed

      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
          ]
      
      

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

              Created:
              Updated:
              Resolved: