diff --git a/rpc/lib/client/http_client.go b/rpc/lib/client/http_client.go index bd3846c6..734ac5b1 100644 --- a/rpc/lib/client/http_client.go +++ b/rpc/lib/client/http_client.go @@ -146,9 +146,8 @@ func unmarshalResponseBytes(responseBytes []byte, result interface{}) (interface if err != nil { return nil, errors.Errorf("Error unmarshalling rpc response: %v", err) } - errorStr := response.Error.Message - if errorStr != "" { - return nil, errors.Errorf("Response error: %v", errorStr) + if response.Error != nil && response.Error.Message != "" { + return nil, errors.Errorf("Response error: %v", response.Error.Message) } // unmarshal the RawMessage into the result err = json.Unmarshal(*response.Result, result)