ing
This commit is contained in:
parent
092ac44a9a
commit
e868bf48ee
|
@ -51,7 +51,7 @@ func (ccn *ClientCodecNotify) ReadParams(args []interface{}) error {
|
||||||
if ccn.err == nil && ccn.notify.Params != nil {
|
if ccn.err == nil && ccn.notify.Params != nil {
|
||||||
// Note: if scr.request.Params is nil it's not an error, it's an optional member.
|
// Note: if scr.request.Params is nil it's not an error, it's an optional member.
|
||||||
// JSON params structured object. Unmarshal to the args object.
|
// JSON params structured object. Unmarshal to the args object.
|
||||||
if err := json.Unmarshal(*ccn.notify.Params, args); err != nil {
|
if err := json.Unmarshal(*ccn.notify.Params, &args); err != nil {
|
||||||
ccn.err = &Error{
|
ccn.err = &Error{
|
||||||
Code: E_INVALID_REQ,
|
Code: E_INVALID_REQ,
|
||||||
Message: err.Error(),
|
Message: err.Error(),
|
||||||
|
|
|
@ -164,7 +164,7 @@ func (scr *ServerCodecRequest) ReadParams(args []interface{}) error {
|
||||||
if scr.err == nil && scr.request.Params != nil {
|
if scr.err == nil && scr.request.Params != nil {
|
||||||
// Note: if scr.request.Params is nil it's not an error, it's an optional member.
|
// Note: if scr.request.Params is nil it's not an error, it's an optional member.
|
||||||
// JSON params structured object. Unmarshal to the args object.
|
// JSON params structured object. Unmarshal to the args object.
|
||||||
if err := json.Unmarshal(*scr.request.Params, args); err != nil {
|
if err := json.Unmarshal(*scr.request.Params, &args); err != nil {
|
||||||
// Clearly JSON params is not a structured object,
|
// Clearly JSON params is not a structured object,
|
||||||
// fallback and attempt an unmarshal with JSON params as
|
// fallback and attempt an unmarshal with JSON params as
|
||||||
// array value and RPC params is struct. Unmarshal into
|
// array value and RPC params is struct. Unmarshal into
|
||||||
|
|
Loading…
Reference in New Issue
Block a user