From f222668934dc1bf8c2c9d3c5ae2d61a6598a7b60 Mon Sep 17 00:00:00 2001 From: Joey Parrish Date: Mon, 19 Aug 2024 23:28:28 -0700 Subject: [PATCH] fix: Fix error thrown after catching null error (#7177) Sometimes, this catches a "null" error. This shouldn't happen, but if it does, we shouldn't throw yet another exception while handling it. --- lib/player.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/player.js b/lib/player.js index 0dfe530f21..5a0805204f 100644 --- a/lib/player.js +++ b/lib/player.js @@ -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;