Throw error when web3 provider returns no accounts

This commit is contained in:
Germán Martínez 2019-09-27 12:31:42 +02:00
parent 6e52f0fddd
commit 5523383781

View File

@ -79,7 +79,7 @@ export const getProviderInfo: Function = async (): Promise<ProviderProps> => {
try {
const accounts = await web3Provider.enable()
if (!accounts) {
console.error('Empty web3 provider')
throw new Error()
}
} catch (error) {
console.error('Error when enabling web3 provider', error)