diff --git a/static/js/modes/waterfall.js b/static/js/modes/waterfall.js index 879e146..581116f 100644 --- a/static/js/modes/waterfall.js +++ b/static/js/modes/waterfall.js @@ -2996,6 +2996,8 @@ const Waterfall = (function () { }; _ws.onclose = () => { + // stop() sets _ws = null before the async onclose fires. + if (!_ws) return; if (!_wsOpened && _active) { // Wait for timeout-based fallback; avoid flapping to SSE on brief close/retry. _setStatus('WebSocket closed before ready. Waiting to retry/fallback...');