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) {