From c70b8405202d1cfde90c5e72d3bdbc9fdaf32187 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20T=C3=A4kker?= Date: Tue, 6 Oct 2026 02:47:37 +0200 Subject: [PATCH] Guard player frequency samples --- app/plugins/player.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/plugins/player.ts b/app/plugins/player.ts index 7d63ced..b6c89a2 100644 --- a/app/plugins/player.ts +++ b/app/plugins/player.ts @@ -172,7 +172,7 @@ export default defineNuxtPlugin((nuxtApp) => { ) let bass = 0 for (let bin = firstBin; bin <= lastBin; bin++) - bass += samples[bin] + bass += samples[bin] ?? 0 bass /= Math.max(1, lastBin - firstBin + 1) * 255 if (previousBass === null) previousBass = bass const rise = Math.max(0, bass - previousBass)