From ee5ac6b800c16ad16fffe45c168df2a1434e7488 Mon Sep 17 00:00:00 2001 From: fragosti Date: Mon, 9 Jul 2018 16:16:48 -0700 Subject: Fix unsubscribe bug --- packages/website/ts/blockchain.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'packages') diff --git a/packages/website/ts/blockchain.ts b/packages/website/ts/blockchain.ts index fde134b18..5476fcf37 100644 --- a/packages/website/ts/blockchain.ts +++ b/packages/website/ts/blockchain.ts @@ -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(); } -- cgit v1.2.3