From a6a5186180fb85a2a9c791444c02ac91bfaa09fc Mon Sep 17 00:00:00 2001 From: Kris Anderson Date: Thu, 9 Jul 2026 16:21:14 -0400 Subject: [PATCH] fix(highway_3d): make _bgPanelKey throw-safe on panelIndexFor Follow-up to the _bgPanelKey alias fix: _freeCamFor already treats panelIndexFor as potentially throwy and catches to keep framing stable, but _bgPanelKey called it bare. A throwing splitscreen build would take down background-settings resolution (and the render path) even though the camera path falls back safely. Wrap the call in try/catch, falling back to 'main'. Co-Authored-By: Claude Opus 4.8 (1M context) Signed-off-by: Kris Anderson --- plugins/highway_3d/screen.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/plugins/highway_3d/screen.js b/plugins/highway_3d/screen.js index f5351a0..1533bc7 100644 --- a/plugins/highway_3d/screen.js +++ b/plugins/highway_3d/screen.js @@ -2596,10 +2596,14 @@ const FRET_NUMBER_GHOST_SCOPE_IDS = ['chords', 'all']; function _bgPanelKey(canvas) { - // Defensive on the splitscreen global name (rename in flight) so per-panel - // background settings keep resolving the same panel as _freeCamFor(). + // Defensive on the splitscreen global name (rename in flight) AND throw-safe + // on panelIndexFor — same as _freeCamFor — so a misbehaving splitscreen + // build can't take down background-settings resolution. Falls back to 'main'. const ss = window.feedBackSplitscreen || window.slopsmithSplitscreen; - const idx = (ss && typeof ss.panelIndexFor === 'function') ? ss.panelIndexFor(canvas) : null; + let idx = null; + if (ss && typeof ss.panelIndexFor === 'function') { + try { idx = ss.panelIndexFor(canvas); } catch (e) { idx = null; } + } return (idx == null) ? 'main' : 'panel' + idx; }