Skip to content

Commit

Permalink
Merge pull request #3489 from ethereum/issue/3485-redux
Browse files Browse the repository at this point in the history
Add provider existence check to WebsocketProvider close emitter logic
  • Loading branch information
ryanio authored Apr 27, 2020
2 parents dccb815 + 8e23d24 commit 682bb84
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/web3-core-requestmanager/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,11 @@ RequestManager.prototype.setProvider = function (provider, net) {
_this.subscriptions.delete(subscription.subscription.id);
});

if(_this.provider.emit){
if(_this.provider && _this.provider.emit){
_this.provider.emit('error', errors.ConnectionCloseError(event));
}
}
if(_this.provider.emit){
if(_this.provider && _this.provider.emit){
_this.provider.emit('end', event);
}
});
Expand Down

0 comments on commit 682bb84

Please sign in to comment.