Skip to content

Commit

Permalink
-- bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
rocketlaunchr-cto committed Oct 16, 2018
1 parent 65a03a3 commit dc2e2df
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ func SToMap(s interface{}) map[string]interface{} {
return nil
}

if jsObjectIsNil(s) {
return nil
}

// Check if s is a struct
if isStruct(s) {
return convertStruct(s)
Expand All @@ -27,6 +31,10 @@ func SToMap(s interface{}) map[string]interface{} {
case map[string]interface{}:
return x
default:
s := reflect.ValueOf(x)
if s.IsNil() {
return nil
}
panic("unrecognized type")
}
}
Expand Down

0 comments on commit dc2e2df

Please sign in to comment.