From 034b77a8b9645e29d7cb007e0c65474aa1298a08 Mon Sep 17 00:00:00 2001 From: Mart G <46025304+martgil@users.noreply.github.com> Date: Fri, 24 May 2024 17:32:18 +0800 Subject: [PATCH] Fix error when sending blank signed message (#5732) Co-authored-by: martgil --- extension/js/common/core/crypto/pgp/openpgp-key.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/extension/js/common/core/crypto/pgp/openpgp-key.ts b/extension/js/common/core/crypto/pgp/openpgp-key.ts index d6cce086b1c..098f1591e0d 100644 --- a/extension/js/common/core/crypto/pgp/openpgp-key.ts +++ b/extension/js/common/core/crypto/pgp/openpgp-key.ts @@ -268,6 +268,7 @@ export class OpenPGPKey { const message = await opgp.createMessage({ text }); return await opgp.sign({ message, format: 'armored', signingKeys: [signingPrv], detached }); } + text = text ? text : '\n'; const message = await opgp.createCleartextMessage({ text }); return await opgp.sign({ message, signingKeys: [signingPrv] }); }