forked from cerc-io/plugeth
rpc: fix unmarshaling of null result in CallContext (#26723)
The change fixes unmarshaling of JSON null results into json.RawMessage. --------- Co-authored-by: Jason Yuan <jason.yuan@curvegrid.com> Co-authored-by: Jason Yuan <jason.yuan869@gmail.com>
This commit is contained in:
co-authored by
Jason Yuan
Jason Yuan
parent
7c749c947a
commit
1db978ca6b
+4
-1
@@ -345,7 +345,10 @@ func (c *Client) CallContext(ctx context.Context, result interface{}, method str
|
||||
case len(resp.Result) == 0:
|
||||
return ErrNoResult
|
||||
default:
|
||||
return json.Unmarshal(resp.Result, &result)
|
||||
if result == nil {
|
||||
return nil
|
||||
}
|
||||
return json.Unmarshal(resp.Result, result)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user