Skip to content

Commit

Permalink
fix untyped-nil case for fixNilList()
Browse files Browse the repository at this point in the history
  • Loading branch information
ntbosscher committed Sep 30, 2020
1 parent 3922dd3 commit 0cf2362
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions res/responder.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,11 @@ func Ok(data ...interface{}) Responder {
func fixNilList(input interface{}) interface{} {
typ := reflect.TypeOf(input)

// interface is untyped nil
if typ == nil {
return input
}

switch typ.Kind() {
case reflect.Slice:
fallthrough
Expand Down

0 comments on commit 0cf2362

Please # to comment.