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

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 0.0.2
    • Affects Version/s: 0.0.1
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • 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:
            Samuel Rossi (Inactive)
            Reporter:
            Kristofer Brandow (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: