Skip to content

Commit

Permalink
fix: Marshal empty interface
Browse files Browse the repository at this point in the history
  • Loading branch information
Canh Nguyen committed Sep 30, 2020
1 parent b3555cb commit 56e3cbe
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions sheriff.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ type Marshaller interface {
// In all other cases we can't derive the type in a meaningful way and is therefore an `interface{}`.
func Marshal(options *Options, data interface{}) (interface{}, error) {
v := reflect.ValueOf(data)
if !v.IsValid() {
return data, nil
}
t := v.Type()

// Initialise nestedGroupsMap,
Expand Down

0 comments on commit 56e3cbe

Please sign in to comment.