From af92e34c82a0ca04e317370e3b24cdcf10801cb2 Mon Sep 17 00:00:00 2001 From: steveluscher Date: Fri, 2 Dec 2022 23:06:30 +0000 Subject: [PATCH] fix: prevent the first-ever signature subscription from leaking --- web3.js/src/connection.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web3.js/src/connection.ts b/web3.js/src/connection.ts index 9a746f30731998..9e643a93308bee 100644 --- a/web3.js/src/connection.ts +++ b/web3.js/src/connection.ts @@ -3712,7 +3712,7 @@ export class Connection { disposeSignatureSubscriptionStateChangeObserver(); disposeSignatureSubscriptionStateChangeObserver = undefined; } - if (signatureSubscriptionId) { + if (signatureSubscriptionId != null) { this.removeSignatureListener(signatureSubscriptionId); signatureSubscriptionId = undefined; }