diff --git a/packages/crypto/src/decryption.ts b/packages/crypto/src/decryption.ts index 15a10659e..b5198c874 100644 --- a/packages/crypto/src/decryption.ts +++ b/packages/crypto/src/decryption.ts @@ -98,6 +98,7 @@ export default class Decryption { chunk, null ); + if (!message) throw new Error("Could not decrypt chunk."); controller.enqueue(message); if (tag === crypto_secretstream_xchacha20poly1305_TAG_FINAL) controller.terminate();