From 6c1b2ddd786972af5b373d5c013b0f674f3870d3 Mon Sep 17 00:00:00 2001 From: Thibaut Sardan <33178835+Tbaut@users.noreply.github.com> Date: Fri, 4 Sep 2020 16:44:47 +0200 Subject: [PATCH] Throw error for undefined name in web3Enable (#430) * throw error for undefined name * lint --- packages/extension-dapp/src/index.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/extension-dapp/src/index.ts b/packages/extension-dapp/src/index.ts index eb779eb4..26b68895 100644 --- a/packages/extension-dapp/src/index.ts +++ b/packages/extension-dapp/src/index.ts @@ -40,6 +40,10 @@ export { isWeb3Injected, web3EnablePromise }; // enables all the providers found on the injected window interface export function web3Enable (originName: string): Promise { + if (!originName) { + throw new Error('You must pass a name for your app to the web3Enable function'); + } + web3EnablePromise = documentReadyPromise((): Promise => Promise .all(