Skip to content

Commit

Permalink
fix(ABR): Add a guard when variant is null (#6928)
Browse files Browse the repository at this point in the history
This rare case can occur when a stream is disabled and this stream
disables the entire variant.
  • Loading branch information
avelad committed Jul 1, 2024
1 parent 94edc8c commit a140a67
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/abr/simple_abr_manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ shaka.abr.SimpleAbrManager = class {
}

let normalVariants = this.variants_.filter((variant) => {
return !shaka.util.StreamUtils.isFastSwitching(variant);
return variant && !shaka.util.StreamUtils.isFastSwitching(variant);
});
if (!normalVariants.length) {
normalVariants = this.variants_;
Expand All @@ -203,7 +203,7 @@ shaka.abr.SimpleAbrManager = class {
if (preferFastSwitching &&
normalVariants.length != this.variants_.length) {
variants = this.variants_.filter((variant) => {
return shaka.util.StreamUtils.isFastSwitching(variant);
return variant && shaka.util.StreamUtils.isFastSwitching(variant);
});
}

Expand Down

0 comments on commit a140a67

Please sign in to comment.