From 9bf857f14c87dd54705254b3b1249c7154806eba Mon Sep 17 00:00:00 2001 From: Vishal Rana Date: Sun, 14 Jul 2019 22:39:07 -0700 Subject: [PATCH] Nil check for bind #988 Signed-off-by: Vishal Rana --- bind.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bind.go b/bind.go index 406de21d..959a314c 100644 --- a/bind.go +++ b/bind.go @@ -88,7 +88,7 @@ func (b *DefaultBinder) Bind(i interface{}, c Context) (err error) { } func (b *DefaultBinder) bindData(ptr interface{}, data map[string][]string, tag string) error { - if len(data) == 0 { + if ptr == nil || len(data) == 0 { return nil } typ := reflect.TypeOf(ptr).Elem()