From 50580a1d918ad2e9968263ba525468010cd12e86 Mon Sep 17 00:00:00 2001 From: Felicio Mununga Date: Thu, 14 Mar 2024 18:24:31 +0900 Subject: [PATCH] f --- .../status-js/src/request-client/request-client.ts | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/packages/status-js/src/request-client/request-client.ts b/packages/status-js/src/request-client/request-client.ts index 78556ade..9b8c3938 100644 --- a/packages/status-js/src/request-client/request-client.ts +++ b/packages/status-js/src/request-client/request-client.ts @@ -307,12 +307,21 @@ class RequestClient { // eslint-disable-next-line no-empty } - const decodedMetadata = - ApplicationMetadataMessage.fromBinary(messageToDecode) + let decodedMetadata + try { + decodedMetadata = ApplicationMetadataMessage.fromBinary(messageToDecode) + } catch { + return + } + if (!decodedMetadata.payload) { return } + if (!decodedMetadata.signature.length) { + return + } + const signerPublicKeyBytes = recoverPublicKey( decodedMetadata.signature, decodedMetadata.payload