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

Cannot decode pointers to nil / cannot decode *ObjectID

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Critical - P2 Critical - P2
    • 0.1.0
    • Affects Version/s: 0.0.15
    • Component/s: BSON
    • Labels:
      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:
            kris.brandow@mongodb.com Kristofer Brandow (Inactive)
            Reporter:
            ddanna79 Delio D'Anna
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: