diff --git a/bson/bson.go b/bson/bson.go index 579aec13f..e2804b9bf 100644 --- a/bson/bson.go +++ b/bson/bson.go @@ -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() {