Uploaded image for project: 'Go Driver'
  1. Go Driver
  2. GODRIVER-245

Ensure methods of *Document handle the case where *Document is nil

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • 0.0.2
    • 0.0.1
    • None
    • None

    Description

      Currently, when *bson.Document is nil and we call methods on it, strange things happen, like panics during validation. For the methods of bson.Document that have a pointer receiver, add a check to ensure that the document itself is not nil and if it is either panic or return an error.

      For certain cases (like printing out the Document), we may want to print "<nil>" instead of return an error, or some other representation of a nil Document.

      Attachments

        Activity

          People

            sam.rossi@mongodb.com Samuel Rossi (Inactive)
            kris.brandow@mongodb.com Kristofer Brandow (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: