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