From 80844881787fb8c5679ac5bcd18e43ddc23a8673 Mon Sep 17 00:00:00 2001 From: Tasso Evangelista Date: Thu, 21 Nov 2024 10:36:00 -0300 Subject: [PATCH] fix(mp3-encoder): Suppress assertion (#1481) --- .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); } }