Fix unsubscribe bug

This commit is contained in:
fragosti
2018-07-09 16:16:48 -07:00
parent a481d2ab46
commit ee5ac6b800

View File

@@ -537,7 +537,9 @@ export class Blockchain {
}
public destroy(): void {
this._blockchainWatcher.destroy();
this._injectedProviderObservable.unsubscribe(this._injectedProviderUpdateHandler);
if (this._injectedProviderObservable) {
this._injectedProviderObservable.unsubscribe(this._injectedProviderUpdateHandler);
}
this._stopWatchingExchangeLogFillEvents();
this._stopWatchingGasPrice();
}