From 9725a4552e1c4ac0a90815dcb124f67ac2baf583 Mon Sep 17 00:00:00 2001 From: Steven Luscher Date: Fri, 2 Dec 2022 15:09:42 -0800 Subject: [PATCH] fix: prevent the first-ever signature subscription from leaking (#29056) --- 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 9a746f3073..9e643a9330 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; }