Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions bson/bson.go
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,9 @@ func Unmarshal(in []byte, out interface{}) (err error) {
// See the Unmarshal function documentation for more details on the
// unmarshalling process.
func (raw Raw) Unmarshal(out interface{}) (err error) {
if len(raw.Data) == 0 {
return SetZero
}
defer handleErr(&err)
v := reflect.ValueOf(out)
switch v.Kind() {
Expand Down