From eaec80e9268992851e09a86909df33ba77383792 Mon Sep 17 00:00:00 2001 From: Alex Date: Wed, 6 Dec 2023 17:27:33 -0600 Subject: [PATCH] cleanup --- packages/polling-controller/src/PollingController.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/polling-controller/src/PollingController.ts b/packages/polling-controller/src/PollingController.ts index 4f524e01ef..0080387f1f 100644 --- a/packages/polling-controller/src/PollingController.ts +++ b/packages/polling-controller/src/PollingController.ts @@ -143,8 +143,10 @@ function PollingControllerMixin(Base: TBase) { found = true; tokenSet.delete(pollingToken); if (tokenSet.size === 0) { - clearTimeout(this.#intervalIds[key]); - delete this.#intervalIds[key]; + if (this.#intervalIds[key]) { + clearTimeout(this.#intervalIds[key]); + delete this.#intervalIds[key]; + } // if applicable stop listening for new blocks if (this.#getNetworkClientById !== undefined) {