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