From 16ee48b1ad98efdb89fefcc3791d065d20cf203f Mon Sep 17 00:00:00 2001 From: Michael Vines Date: Thu, 23 Aug 2018 19:47:00 -0700 Subject: [PATCH] Throw if endpoind is not provided --- web3.js/src/connection.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/web3.js/src/connection.js b/web3.js/src/connection.js index 1f046314d3..369de05002 100644 --- a/web3.js/src/connection.js +++ b/web3.js/src/connection.js @@ -105,6 +105,9 @@ export class Connection { _rpcRequest: RpcRequest; constructor(endpoint: string) { + if (typeof endpoint !== 'string') { + throw new Error('Connection endpoint not specified'); + } this._rpcRequest = createRpcRequest(endpoint); }