From 0287ab2c8932a57cf639df8748927f6340bb5225 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 | 7 +++++-- 2 files changed, 10 insertions(+), 2 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..02ebedd295 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. + // throw new Error(message); } }