fix undefined `connection` in provider

This commit is contained in:
Jonathan Rainville 2018-10-23 10:42:14 -04:00
parent 81c62b1006
commit e62a5503a9
1 changed files with 1 additions and 1 deletions

View File

@ -76,7 +76,7 @@ class Provider {
if (this.type === 'rpc') {
return !!this.provider;
} else if (this.type === 'ws') {
return this.provider && this.provider.connection._connection.connected;
return this.provider && this.provider.connection._connection && this.provider.connection._connection.connected;
}
return false;