From 9946554cbed948fed0b80136dcb8ef2ba538252e Mon Sep 17 00:00:00 2001 From: Tasso Date: Fri, 8 Nov 2024 14:53:28 -0300 Subject: [PATCH] fix(mp3-encoder): Suppress assertion --- .changeset/ninety-monkeys-notice.md | 5 +++++ packages/mp3-encoder/src/lame/assert.ts | 11 +++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) create mode 100644 .changeset/ninety-monkeys-notice.md diff --git a/.changeset/ninety-monkeys-notice.md b/.changeset/ninety-monkeys-notice.md new file mode 100644 index 0000000000..cfeea39054 --- /dev/null +++ b/.changeset/ninety-monkeys-notice.md @@ -0,0 +1,5 @@ +--- +'@rocket.chat/mp3-encoder': patch +--- + +Suppressed assertions at the LAME encoding due to unknown `NaN` values diff --git a/packages/mp3-encoder/src/lame/assert.ts b/packages/mp3-encoder/src/lame/assert.ts index 41e66ac678..cb24991b6b 100644 --- a/packages/mp3-encoder/src/lame/assert.ts +++ b/packages/mp3-encoder/src/lame/assert.ts @@ -1,8 +1,11 @@ export function assert( condition: boolean, - message?: string, + _message?: string, ): asserts condition { - if (!condition) { - throw new Error(message); - } + // TODO: There is a condition generating multiple NaN values that was never + // addressed in the original code and is not clear how to handle it. + // Originally this assertion was commented out, probably because of it. + // if (!condition) { + // throw new Error(message); + // } }