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

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

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 0.0.2
    • Affects Version/s: 0.0.1
    • Component/s: None
    • None

      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.

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

              Created:
              Updated:
              Resolved: