Throw error for undefined name in web3Enable (#430)

* throw error for undefined name

* lint
This commit is contained in:
Thibaut Sardan
2020-09-04 16:44:47 +02:00
committed by GitHub
parent c97ab5e48a
commit 6c1b2ddd78
+4
View File
@@ -40,6 +40,10 @@ export { isWeb3Injected, web3EnablePromise };
// enables all the providers found on the injected window interface
export function web3Enable (originName: string): Promise<InjectedExtension[]> {
if (!originName) {
throw new Error('You must pass a name for your app to the web3Enable function');
}
web3EnablePromise = documentReadyPromise((): Promise<InjectedExtension[]> =>
Promise
.all(