Skip to content

Commit

Permalink
Allow nil lists.
Browse files Browse the repository at this point in the history
  • Loading branch information
nicerobot committed Sep 10, 2016
1 parent 3ac1aab commit 649c208
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions marshal.go
Original file line number Diff line number Diff line change
Expand Up @@ -1143,6 +1143,10 @@ func marshalList(info TypeInfo, value interface{}) ([]byte, error) {
return nil, marshalErrorf("marshal: can not marshal non collection type into list")
}

if value == nil {
return nil, nil
}

rv := reflect.ValueOf(value)
t := rv.Type()
k := t.Kind()
Expand Down

0 comments on commit 649c208

Please sign in to comment.