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); }