Cannot decode pointers to nil / cannot decode *ObjectID

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Critical - P2
    • 0.1.0
    • Affects Version/s: 0.0.15
    • Component/s: BSON
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Decoding a nil into *time.Time returns an error, *time.Time is a pointer so it should be possible to decode nul from the database into a nil but this returns an error.

      Same thing happens with ObjectID and possible other default_value_decoders.

      In ObjectID though there is another issue too, not only it is not possible to decode into nil, but it does not even accept a pointer to ObjectID, the check/type assertion .(**bson.ObjectId) is totally missing form the code, while is present in TimeDecodeValue

      The affected file seems bson/bsoncodec/default_value_decoders.go

            Assignee:
            Kristofer Brandow (Inactive)
            Reporter:
            Delio D'Anna
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: