From 53aea7af6ef1430a1cf099716e270b66bfbf05a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonatan=20K=C5=82osko?= Date: Thu, 10 Feb 2022 11:25:37 +0100 Subject: [PATCH] Leave JS output channel only if it exists --- assets/js/js_output/index.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/assets/js/js_output/index.js b/assets/js/js_output/index.js index 57b3b47c4..9200bf543 100644 --- a/assets/js/js_output/index.js +++ b/assets/js/js_output/index.js @@ -241,9 +241,11 @@ function getChannel(sessionId, { create = true } = {}) { * Leaves the JS outputs channel tied to the current session. */ export function leaveChannel() { - channel.leave(); - channel = null; - socket.disconnect(); + if (channel) { + channel.leave(); + channel = null; + socket.disconnect(); + } } /**