Skip to content

Commit

Permalink
fix: Fix error thrown after catching null error (#7177)
Browse files Browse the repository at this point in the history
Sometimes, this catches a "null" error. This shouldn't happen, but if it
does, we shouldn't throw yet another exception while handling it.
  • Loading branch information
joeyparrish committed Aug 20, 2024
1 parent 2223a96 commit f222668
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -1749,7 +1749,7 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
this.dispatchEvent(shaka.Player.makeEvent_(
shaka.util.FakeEvent.EventName.Loaded));
} catch (error) {
if (error.code != shaka.util.Error.Code.LOAD_INTERRUPTED) {
if (error && error.code != shaka.util.Error.Code.LOAD_INTERRUPTED) {
await this.unload(/* initializeMediaSource= */ false);
}
throw error;
Expand Down

0 comments on commit f222668

Please sign in to comment.