mirror of
https://github.com/owncast/owncast.git
synced 2024-11-26 23:24:29 +03:00
Guard against possible invalid tech usage
This commit is contained in:
parent
a8fff63500
commit
7935bcf5f3
1 changed files with 5 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue