[GODRIVER-1423] Nil interface panics in BSON marshalling Created: 03/Dec/19  Updated: 28/Oct/23  Resolved: 04/Dec/19

Status: Closed
Project: Go Driver
Component/s: None
Affects Version/s: None
Fix Version/s: 1.2.0

Type: Bug Priority: Major - P3
Reporter: Divjot Arora (Inactive) Assignee: Isabella Siu (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File main.go    

 Description   

Repro attached. We can probably check if the value is nil and the reflect.Kind is an interface. In this case, either marshal to BSON null or leave out the field if omitempty is given in a struct.

main.go



 Comments   
Comment by Githook User [ 04/Dec/19 ]

Author:

{'email': 'isabella.siu@10gen.com', 'name': 'iwysiu', 'username': 'iwysiu'}

Message: GODRIVER-1423 bson should marshal nil interfaces (#243)
Branch: master
https://github.com/mongodb/mongo-go-driver/commit/7eeaa5b5707d0fdae18f100260a2d21374b9ddff

Generated at Thu Feb 08 08:36:22 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.