From c5276cca6cbf79119932da11193eb83c607e0788 Mon Sep 17 00:00:00 2001 From: Lea Anthony Date: Tue, 19 Mar 2019 08:20:45 +1100 Subject: [PATCH] fix: convert js nulls to Go zero values --- binding_function.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/binding_function.go b/binding_function.go index f459fb8bb..6b33c38e4 100644 --- a/binding_function.go +++ b/binding_function.go @@ -153,8 +153,11 @@ func (b *boundFunction) setInputValue(index int, typ reflect.Type, val interface } }() - // Do the conversion - result = reflect.ValueOf(val).Convert(typ) - + // Translate javascript null values + if val == nil { + result = reflect.Zero(typ) + } else { + result = reflect.ValueOf(val).Convert(typ) + } return result, err }