diff options
Diffstat (limited to 'packages/0x.js/src/order_watcher')
-rw-r--r-- | packages/0x.js/src/order_watcher/expiration_watcher.ts | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/packages/0x.js/src/order_watcher/expiration_watcher.ts b/packages/0x.js/src/order_watcher/expiration_watcher.ts index 6d9556336..f9c6571db 100644 --- a/packages/0x.js/src/order_watcher/expiration_watcher.ts +++ b/packages/0x.js/src/order_watcher/expiration_watcher.ts @@ -35,7 +35,10 @@ export class ExpirationWatcher { ); } public unsubscribe(): void { - intervalUtils.clearAsyncExcludingInterval(this.orderExpirationCheckingIntervalIdIfExists as NodeJS.Timer); + if (_.isUndefined(this.orderExpirationCheckingIntervalIdIfExists)) { + throw new Error(ZeroExError.SubscriptionNotFound); + } + intervalUtils.clearAsyncExcludingInterval(this.orderExpirationCheckingIntervalIdIfExists); delete this.callbackIfExists; } public addOrder(orderHash: string, expirationUnixTimestampSec: BigNumber): void { |