From 26b661ef54d358061fc8f5c06eb0e7e207ec5d3f Mon Sep 17 00:00:00 2001 From: Ivan Novak Date: Tue, 16 Apr 2024 14:41:56 +0200 Subject: [PATCH] check for undefined privateKey instead of null --- src/signed-xml.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/signed-xml.ts b/src/signed-xml.ts index 86ff8e9..e537e4e 100644 --- a/src/signed-xml.ts +++ b/src/signed-xml.ts @@ -341,7 +341,7 @@ export class SignedXml { const signedInfoCanon = this.getCanonSignedInfoXml(doc); const signer = this.findSignatureAlgorithm(this.signatureAlgorithm); const privateKey = this.getPrivateKey(); - if (privateKey == null) { + if (privateKey === undefined) { throw new Error("Private key is required to compute signature"); } if (typeof callback === "function") {