diff options
Diffstat (limited to 'app/scripts/controllers/network.js')
-rw-r--r-- | app/scripts/controllers/network.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/app/scripts/controllers/network.js b/app/scripts/controllers/network.js index 0f9db4d53..23afdc12b 100644 --- a/app/scripts/controllers/network.js +++ b/app/scripts/controllers/network.js @@ -51,6 +51,10 @@ module.exports = class NetworkController extends EventEmitter { } lookupNetwork () { + // Prevent firing when provider is not defined. + if (!this.ethQuery || !this.ethQuery.sendAsync) { + return + } this.ethQuery.sendAsync({ method: 'net_version' }, (err, network) => { if (err) return this.setNetworkState('loading') log.info('web3.getNetwork returned ' + network) @@ -101,7 +105,7 @@ module.exports = class NetworkController extends EventEmitter { this.emit('networkDidChange') } - _configureStandardProvider(_providerParams) { + _configureStandardProvider (_providerParams) { const providerParams = extend(this._baseProviderParams, _providerParams) const provider = createMetamaskProvider(providerParams) this._setProvider(provider) |