Skip to content

Commit

Permalink
fix nil pointer panic (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-dodich authored and ybbus committed Oct 3, 2019
1 parent 88045b9 commit 6b525c7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions jsonrpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ func (client *rpcClient) doCall(RPCRequest *RPCRequest) (*RPCResponse, error) {

httpRequest, err := client.newRequest(RPCRequest)
if err != nil {
return nil, fmt.Errorf("rpc call %v() on %v: %v", RPCRequest.Method, httpRequest.URL.String(), err.Error())
return nil, fmt.Errorf("rpc call %v() on %v: %v", RPCRequest.Method, client.endpoint, err.Error())
}
httpResponse, err := client.httpClient.Do(httpRequest)
if err != nil {
Expand Down Expand Up @@ -436,7 +436,7 @@ func (client *rpcClient) doCall(RPCRequest *RPCRequest) (*RPCResponse, error) {
func (client *rpcClient) doBatchCall(rpcRequest []*RPCRequest) ([]*RPCResponse, error) {
httpRequest, err := client.newRequest(rpcRequest)
if err != nil {
return nil, fmt.Errorf("rpc batch call on %v: %v", httpRequest.URL.String(), err.Error())
return nil, fmt.Errorf("rpc batch call on %v: %v", client.endpoint, err.Error())
}
httpResponse, err := client.httpClient.Do(httpRequest)
if err != nil {
Expand Down

0 comments on commit 6b525c7

Please sign in to comment.