From 7935bcf5f3263c38d5f808acc2aad035940dfff5 Mon Sep 17 00:00:00 2001 From: Gabe Kangas Date: Fri, 22 Apr 2022 10:49:13 -0700 Subject: [PATCH] Guard against possible invalid tech usage --- webroot/js/components/player.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/webroot/js/components/player.js b/webroot/js/components/player.js index 9edfb251b..7376b1a7d 100644 --- a/webroot/js/components/player.js +++ b/webroot/js/components/player.js @@ -292,6 +292,11 @@ class OwncastPlayer { // Quality selected newMenuItem.on('click', function () { + // If for some reason tech doesn't exist, then don't do anything + if (!tech) { + console.warn('Invalid attempt to access null player tech'); + return; + } // Only enable this single, selected representation. tech.vhs.representations().forEach(function (rep, index) { rep.enabled(index === item.index);