Skip to content

Commit 9bf857f

Browse files
committed
Nil check for bind #988
Signed-off-by: Vishal Rana <[email protected]>
1 parent da45981 commit 9bf857f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

bind.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ func (b *DefaultBinder) Bind(i interface{}, c Context) (err error) {
8888
}
8989

9090
func (b *DefaultBinder) bindData(ptr interface{}, data map[string][]string, tag string) error {
91-
if len(data) == 0 {
91+
if ptr == nil || len(data) == 0 {
9292
return nil
9393
}
9494
typ := reflect.TypeOf(ptr).Elem()

0 commit comments

Comments
 (0)