check is valid fo .object()
This commit is contained in:
parent
c78548f50d
commit
4412bfc727
4
http.go
4
http.go
@ -138,7 +138,9 @@ func toObject(argsIn goja.FunctionCall, vm *goja.Runtime) goja.Value {
|
||||
if data, ok := dataValue.Export().([]byte); ok {
|
||||
obj := u.UnJsonBytes(data, nil)
|
||||
v := u.FinalValue(reflect.ValueOf(obj))
|
||||
return vm.ToValue(v.Interface())
|
||||
if v.IsValid() {
|
||||
return vm.ToValue(v.Interface())
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user